Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Improvements #65

Merged
merged 22 commits into from
Jan 24, 2024
Merged

Improvements #65

merged 22 commits into from
Jan 24, 2024

Conversation

kamil-stasiak
Copy link
Contributor

@kamil-stasiak kamil-stasiak commented Jan 18, 2024

  • Remove started tracks after disconnecting.
  • Display at most one error of the same type.
  • Allow setting a custom room ID.
  • Custom room IDs can be auto-incremented.
  • Show server state now displays HTTP response.
  • Rooms are sorted.
  • Peers are sorted.
  • The jellyfish instance is automatically selected.

@kamil-stasiak kamil-stasiak marked this pull request as ready for review January 18, 2024 17:00
src/utils/url.ts Outdated
@@ -0,0 +1,20 @@
export const isValidHttpUrl = (url: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that function is actually used in any import. I would consider inlining it inside isValidJellyfishWebhookUrl. It would save us one call to URL constructor.


try {
const { pathname, origin } = new URL(url);
return url !== origin || pathname !== "/";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that url !== origin is needed here, if they are equal, the pathname will also equal "/"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without it http://localhost:3000/this URL is considered invalid

| { type: "SET_TRACK_STREAMED"; roomId: string; peerId: string; trackId: string; serverId?: string };

export type AppStore = {
rooms: Record<string, RoomState>;
selectedRoom: string | null;
};

const deepCopyStateUpToPeer = (state: AppStore, roomId: string, peerId: string): AppStore => ({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the name of the function accurately describes it. The are copying the state of the peer, it's just the tracks that are reset .

setIsWss(false);
setHost(value.replace("http://", ""));
} else {
setHost(event.target.value.trim());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
setHost(event.target.value.trim());
setHost(value);

src/components/CreateRoom.tsx Outdated Show resolved Hide resolved

const [roomId, setRoomId] = useAtom(roomIdAtom(host));
const [roomIdInput, setRoomIdInput] = useAtom(roomIdInputAtom);
const [roomIdAutoIncrementCheckbox, setRoomIdAutoIncrement] = useAtom(roomIdAutoIncrementCheckboxAtom);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setter and getter names not consistent

};

const onChangeWebhookUrl = (event: ChangeEvent<HTMLInputElement>) => {
setWebhookUrl(event.target.value === "" ? null : event.target.value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should trim the value?

</label>

<div className="flex flex-row gap-2 items-center">
<span className="text">Webhook URL</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably use <label> for accessibility instead

@kamil-stasiak kamil-stasiak merged commit 5f01df4 into main Jan 24, 2024
1 check passed
@kamil-stasiak kamil-stasiak deleted the improvements branch January 24, 2024 13:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants