refac
Some checks are pending
Deploy to HuggingFace Spaces / check-secret (push) Waiting to run
Deploy to HuggingFace Spaces / deploy (push) Blocked by required conditions
Create and publish Docker images with specific build args / build-main-image (linux/amd64) (push) Waiting to run
Create and publish Docker images with specific build args / build-main-image (linux/arm64) (push) Waiting to run
Create and publish Docker images with specific build args / build-cuda-image (linux/amd64) (push) Waiting to run
Create and publish Docker images with specific build args / build-cuda-image (linux/arm64) (push) Waiting to run
Create and publish Docker images with specific build args / build-ollama-image (linux/amd64) (push) Waiting to run
Create and publish Docker images with specific build args / build-ollama-image (linux/arm64) (push) Waiting to run
Create and publish Docker images with specific build args / merge-main-images (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge-cuda-images (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge-ollama-images (push) Blocked by required conditions
Python CI / Format Backend (3.11) (push) Waiting to run
Frontend Build / Format & Build Frontend (push) Waiting to run
Frontend Build / Frontend Unit Tests (push) Waiting to run
Integration Test / Run Cypress Integration Tests (push) Waiting to run
Integration Test / Run Migration Tests (push) Waiting to run

This commit is contained in:
Timothy Jaeryang Baek 2024-12-24 22:04:43 -07:00
parent 31a97d8fec
commit e39617b1c0
2 changed files with 6 additions and 2 deletions

View File

@ -2,7 +2,7 @@
import { toast } from 'svelte-sonner'; import { toast } from 'svelte-sonner';
import { onDestroy, onMount, tick } from 'svelte'; import { onDestroy, onMount, tick } from 'svelte';
import { showSidebar, socket } from '$lib/stores'; import { chatId, showSidebar, socket } from '$lib/stores';
import { getChannelById, getChannelMessages, sendMessage } from '$lib/apis/channels'; import { getChannelById, getChannelMessages, sendMessage } from '$lib/apis/channels';
import Messages from './Messages.svelte'; import Messages from './Messages.svelte';
@ -98,6 +98,10 @@
}; };
onMount(() => { onMount(() => {
if ($chatId) {
chatId.set('');
}
$socket?.on('channel-events', channelEventHandler); $socket?.on('channel-events', channelEventHandler);
}); });

View File

@ -96,7 +96,7 @@
const chat = $page.url.pathname.includes(`/c/${event.chat_id}`); const chat = $page.url.pathname.includes(`/c/${event.chat_id}`);
if ( if (
(!(chat || event.chat_id === $chatId) && !$temporaryChatEnabled) || (event.chat_id !== $chatId && !$temporaryChatEnabled) ||
document.visibilityState !== 'visible' document.visibilityState !== 'visible'
) { ) {
await tick(); await tick();