mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 15:02:21 -04:00
onDestroy must be called from top level
This commit is contained in:
parent
aba8df7708
commit
ee6f5cd0fd
1 changed files with 3 additions and 1 deletions
|
@ -11,9 +11,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
export let state: DeckConfigState;
|
export let state: DeckConfigState;
|
||||||
|
|
||||||
|
let registerCleanup: () => void;
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
onDestroy(registerShortcut(() => state.save(false), "Control+Enter"));
|
registerCleanup = registerShortcut(() => state.save(false), "Control+Enter");
|
||||||
});
|
});
|
||||||
|
onDestroy(() => registerCleanup?.());
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
Loading…
Reference in a new issue