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.
This commit is contained in:
Hikaru Y 2023-02-20 17:23:42 +09:00 committed by GitHub
parent 39ab53d22a
commit f3b2dbd31f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
}
$: duration = dynamicDuration(contentHeight);
const size = tweened<number>(undefined);
const size = tweened<number>(0);
async function transition(collapse: boolean): Promise<void> {
if (collapse) {