Browse Source

fix: message delete issue

Timothy Jaeryang Baek 4 months ago
parent
commit
3da1802eec
2 changed files with 5 additions and 1 deletions
  1. 2 0
      src/lib/components/chat/Chat.svelte
  2. 3 1
      src/lib/components/common/Loader.svelte

+ 2 - 0
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));
 

+ 3 - 1
src/lib/components/common/Loader.svelte

@@ -33,7 +33,9 @@
 	});
 
 	onDestroy(() => {
-		observer.disconnect();
+		if (observer) {
+			observer.disconnect();
+		}
 
 		if (intervalId) {
 			clearInterval(intervalId);