Skip to content

Commit

Permalink
Subscribe to WS in video-information (#1146)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasReumann authored Sep 4, 2023
1 parent 6eb96ea commit 9f1f3eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion web/ts/components/video-information.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function videoInformationContext(streamId: number): AlpineComponent {
this.handleDescriptionUpdate(data);
}
};
SocketConnections.ws.addHandler(handler);
SocketConnections.ws.subscribe(handler);
},

handleViewersUpdate(upd: { viewers: number }) {
Expand Down
6 changes: 2 additions & 4 deletions web/ts/components/video-interaction.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { AlpineComponent } from "./alpine-component";
import { User } from "../api/users";
import { SocketConnections } from "../api/chat-ws";
import { RealtimeFacade } from "../utilities/ws";

enum InteractionType {
Chat,
Expand All @@ -13,9 +12,8 @@ export function videoInteractionContext(user: User) {
type: InteractionType.Chat,
user: user as User,

init() {
SocketConnections.ws.subscribe();
},
// eslint-disable-next-line @typescript-eslint/no-empty-function
init() {},

showChat() {
this.type = InteractionType.Chat;
Expand Down

0 comments on commit 9f1f3eb

Please sign in to comment.