From f3b2dbd31fe8df2710e44d22e90112453649b2bd Mon Sep 17 00:00:00 2001 From: Hikaru Y Date: Mon, 20 Feb 2023 17:23:42 +0900 Subject: [PATCH] Partially fix slow editor startup (#2382) The variable 'collapsed' was initialized with the value 'false' because the initial value of the store 'size' was 'undefined'. This caused an instance of CodeMirror to be created at editor startup, regardless of whether the option 'Use HTML editor by default' was enabled, which significantly slowed down the startup of the editor, especially when there were many fields in the notetype. --- ts/components/Collapsible.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/components/Collapsible.svelte b/ts/components/Collapsible.svelte index b6fb6ad7e..0e8e3c0e2 100644 --- a/ts/components/Collapsible.svelte +++ b/ts/components/Collapsible.svelte @@ -18,7 +18,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html } $: duration = dynamicDuration(contentHeight); - const size = tweened(undefined); + const size = tweened(0); async function transition(collapse: boolean): Promise { if (collapse) {