2021-06-25 18:14:40 +02:00
|
|
|
import { iframeListener } from "../Api/IframeListener";
|
2021-07-07 18:07:58 +02:00
|
|
|
import { chatMessagesStore, chatVisibilityStore } from "../Stores/ChatStore";
|
2020-10-25 21:59:14 +01:00
|
|
|
|
|
|
|
export class DiscussionManager {
|
2020-12-04 11:30:35 +01:00
|
|
|
constructor() {
|
2021-03-04 19:00:00 +01:00
|
|
|
iframeListener.chatStream.subscribe((chatEvent) => {
|
2021-07-07 18:07:58 +02:00
|
|
|
chatMessagesStore.addExternalMessage(parseInt(chatEvent.author), chatEvent.message);
|
|
|
|
chatVisibilityStore.set(true);
|
2020-10-25 21:59:14 +01:00
|
|
|
});
|
2020-11-17 16:46:46 +01:00
|
|
|
}
|
2020-12-04 11:30:35 +01:00
|
|
|
}
|
|
|
|
|
2021-01-21 10:16:08 +01:00
|
|
|
export const discussionManager = new DiscussionManager();
|