Skip to content

Commit

Permalink
fix(storage): refining data from inavailable values of editor caused …
Browse files Browse the repository at this point in the history
…content merge
  • Loading branch information
Muhammed-Rahif committed Nov 24, 2024
1 parent dc7c4a7 commit 35fa06b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib/store/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ export class NotpadStorage {
if (editorsValue) {
// Adding default values to the editors if they are not present
// on in any circumstances if new values are introduced in the future.
const editorsValueRefined = editorsValue?.map((editor) => {
const defaultValue = { ...Editors.defaultEditor, id: undefined };
return merge(defaultValue, editor);
const editorsValueRefined = editorsValue.map((editor) => {
const { id, content, ...rest } = editor;
const defaultValue = { ...Editors.defaultEditor, id, content };
return merge(defaultValue, rest);
});
editors.set(editorsValueRefined);
}
Expand Down

0 comments on commit 35fa06b

Please sign in to comment.