Skip to content

Commit

Permalink
Merge pull request #1249 from CodeCrowCorp/dev
Browse files Browse the repository at this point in the history
Fix: moved websocket listener above emits
  • Loading branch information
gagansuie authored May 15, 2024
2 parents 89f0e13 + fe929c9 commit bbd8055
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/routes/channel/[channelId]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,6 @@
$: isLive = channel?.videoItems?.some((input: any) => input?.rtmps?.isConnected) ?? false
onMount(async () => {
clearInterval(platformPollingInterval)
platformPollingInterval = null
await loadChannel()
await handleWebsocket()
await loadMoreChannels()
$is_chat_drawer_destroy = false
setTimeout(() => {
$is_chat_drawer_open = true
}, 600)
channel_message.subscribe(async (value: any) => {
if (!value || !channel || (channel && parseInt($page.params.channelId) !== channel._id))
return
Expand Down Expand Up @@ -134,6 +124,15 @@
break
}
})
clearInterval(platformPollingInterval)
platformPollingInterval = null
await loadChannel()
await handleWebsocket()
await loadMoreChannels()
$is_chat_drawer_destroy = false
setTimeout(() => {
$is_chat_drawer_open = true
}, 600)
})
onDestroy(async () => {
Expand Down

0 comments on commit bbd8055

Please sign in to comment.