Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: moved websocket listener above emits #1248

Merged
merged 1 commit into from
May 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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