diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index a37ce5be7..255dc4c1b 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -239,6 +239,8 @@ }; const showMessage = async (message) => { + await tick(); + const _chatId = JSON.parse(JSON.stringify($chatId)); let _messageId = JSON.parse(JSON.stringify(message.id)); diff --git a/src/lib/components/common/Loader.svelte b/src/lib/components/common/Loader.svelte index ac7ecaf28..221f6ecf0 100644 --- a/src/lib/components/common/Loader.svelte +++ b/src/lib/components/common/Loader.svelte @@ -33,7 +33,9 @@ }); onDestroy(() => { - observer.disconnect(); + if (observer) { + observer.disconnect(); + } if (intervalId) { clearInterval(intervalId);