diff --git a/web/template/popup-chat.gohtml b/web/template/popup-chat.gohtml index a4814fd2b..fce4c6638 100644 --- a/web/template/popup-chat.gohtml +++ b/web/template/popup-chat.gohtml @@ -17,6 +17,6 @@ -
+ {{template "chat-component" .}} diff --git a/web/ts/components/popup.ts b/web/ts/components/popup.ts new file mode 100644 index 000000000..d423a50d0 --- /dev/null +++ b/web/ts/components/popup.ts @@ -0,0 +1,11 @@ +import { AlpineComponent } from "./alpine-component"; +import { RealtimeFacade } from "../utilities/ws"; +import { SocketConnections } from "../api/chat-ws"; + +export function popupContext(streamId: number): AlpineComponent { + return { + init() { + SocketConnections.ws = new RealtimeFacade("chat/" + streamId); + }, + } as AlpineComponent; +} diff --git a/web/ts/entry/interactions.ts b/web/ts/entry/interactions.ts index 853129a0b..6afe2699f 100644 --- a/web/ts/entry/interactions.ts +++ b/web/ts/entry/interactions.ts @@ -4,3 +4,4 @@ export * from "../components/chat-prompt"; export * from "../components/poll"; export * from "../components/emoji-picker"; export * from "../components/video-information"; +export * from "../components/popup";