From 6ea64bcac51345d6a72763e7071ce60ce7549c1c Mon Sep 17 00:00:00 2001 From: Abdo Date: Wed, 27 Aug 2025 03:55:21 +0300 Subject: [PATCH] Fix TS errors --- ts/routes/editor/NoteEditor.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ts/routes/editor/NoteEditor.svelte b/ts/routes/editor/NoteEditor.svelte index 62c7f651e..8bc571ca1 100644 --- a/ts/routes/editor/NoteEditor.svelte +++ b/ts/routes/editor/NoteEditor.svelte @@ -159,7 +159,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html let fieldsCollapsed: boolean[] = []; export function setCollapsed(defaultCollapsed: boolean[]): void { fieldsCollapsed = - sessionOptions[notetypeMeta?.id?.toString()]?.fieldsCollapsed ?? + sessionOptions[notetypeMeta!.id?.toString()]?.fieldsCollapsed ?? defaultCollapsed; } let clozeFields: boolean[] = []; @@ -172,7 +172,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html let plainTextDefaults: boolean[] = []; export function setPlainTexts(defaultPlainTexts: boolean[]): void { - const states = sessionOptions[notetypeMeta?.id?.toString()]?.fieldStates; + const states = sessionOptions[notetypeMeta!.id?.toString()]?.fieldStates; if (states) { richTextsHidden = states.richTextsHidden; plainTextsHidden = states.plainTextsHidden; @@ -237,7 +237,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html ); } else { const values: boolean[] = []; - const notetype = await getNotetype({ ntid: notetypeMeta.id }); + const notetype = await getNotetype({ ntid: notetypeMeta!.id }); const anySticky = notetype.fields.some((f) => f.config!.sticky); for (const field of notetype.fields) { const sticky = field.config!.sticky; @@ -987,7 +987,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html } const notetype = await getNotetype({ - ntid: notetypeId, + ntid: notetypeId!, }); const fieldNames = ( await getFieldNames({