diff --git a/CONTRIBUTORS b/CONTRIBUTORS index b80ca95ca41..21842ed3f40 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -262,7 +262,7 @@ defkorean Michael Lappas Brett Schwartz Lovro Boban -Yuuki Gabriele Patriarca +Yuuki Gabriele Patriarca SecretX ******************** diff --git a/ts/editor/NoteEditor.svelte b/ts/editor/NoteEditor.svelte index 17ced575bc3..a1df6138274 100644 --- a/ts/editor/NoteEditor.svelte +++ b/ts/editor/NoteEditor.svelte @@ -99,7 +99,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html plainTextsHidden, plainTextDefaults, }, - modTimeOfNotetype: notetypeMeta.modTime, }; } } @@ -155,7 +154,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html export function setPlainTexts(defaultPlainTexts: boolean[]): void { const states = sessionOptions[notetypeMeta?.id]?.fieldStates; - if (states) { + if (states && states.richTextsHidden.length === defaultPlainTexts.length) { richTextsHidden = states.richTextsHidden; plainTextsHidden = states.plainTextsHidden; plainTextDefaults = states.plainTextDefaults; @@ -240,10 +239,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html let notetypeMeta: NotetypeIdAndModTime; function setNotetypeMeta({ id, modTime }: NotetypeIdAndModTime): void { notetypeMeta = { id, modTime }; - // Discard the saved state of the fields if the notetype has been modified. - if (sessionOptions[id]?.modTimeOfNotetype !== modTime) { - delete sessionOptions[id]; - } if (isImageOcclusion) { getImageOcclusionFields({ notetypeId: BigInt(notetypeMeta.id), diff --git a/ts/editor/types.ts b/ts/editor/types.ts index 14cece17536..0282fc4423a 100644 --- a/ts/editor/types.ts +++ b/ts/editor/types.ts @@ -8,7 +8,6 @@ export type EditorOptions = { plainTextsHidden: boolean[]; plainTextDefaults: boolean[]; }; - modTimeOfNotetype: number; }; export type SessionOptions = {