[FIX] add store unsubscribe onDestory AutoSuggest

This commit is contained in:
LL
2023-05-31 20:19:15 +09:00
parent 332cf43935
commit 083cb71d19

View File

@@ -8,6 +8,7 @@
import { alertConfirm } from "src/ts/alert"; import { alertConfirm } from "src/ts/alert";
import { language } from "src/lang"; import { language } from "src/lang";
import { replacePlaceholders } from "../../ts/util"; import { replacePlaceholders } from "../../ts/util";
import { onDestroy } from 'svelte';
export let send; export let send;
export let messageInput; export let messageInput;
@@ -36,7 +37,7 @@
} }
} }
doingChat.subscribe((v) => { const unsubscribe = doingChat.subscribe((v) => {
if(v) { if(v) {
progress=false progress=false
abortController?.abort() abortController?.abort()
@@ -89,6 +90,7 @@
} }
} }
$: {translateSuggest(toggleTranslate, suggestMessages)} $: {translateSuggest(toggleTranslate, suggestMessages)}
onDestroy(unsubscribe)
</script> </script>
<div class="ml-4 flex flex-wrap"> <div class="ml-4 flex flex-wrap">