mirror of
https://github.com/Blah-IM/Weblah.git
synced 2025-04-30 16:21:09 +00:00
fix: properly unsubscribe when chat is closed
This commit is contained in:
parent
cd68c982c8
commit
1bbc149536
1 changed files with 2 additions and 1 deletions
|
@ -31,9 +31,10 @@
|
|||
onMount(() => {
|
||||
const server = new BlahChatServerConnection('https://blah.oxa.li/api');
|
||||
loadChat(server);
|
||||
return server.subscribeRoom(roomId, (message) => {
|
||||
const { unsubscribe } = server.subscribeRoom(roomId, (message) => {
|
||||
messages = [...messages, messageFromBlah(message)];
|
||||
});
|
||||
return unsubscribe;
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue