[FIX] add store unsubscribe onDestory AutoSuggest
This commit is contained in:
@@ -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">
|
||||||
|
|||||||
Reference in New Issue
Block a user