mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
fix: duplicate general topics in restored notebook
This commit is contained in:
@@ -43,11 +43,15 @@ export default class Notebooks extends Collection {
|
||||
title: notebook.title,
|
||||
description: notebook.description,
|
||||
dateCreated: notebook.dateCreated,
|
||||
dateEdited: notebook.dateEdited,
|
||||
pinned: !!notebook.pinned,
|
||||
topics: notebook.topics || [],
|
||||
totalNotes: 0,
|
||||
totalNotes: notebook.totalNotes || 0,
|
||||
};
|
||||
if (!oldNotebook) {
|
||||
if (
|
||||
!oldNotebook &&
|
||||
notebook.topics.findIndex((topic) => topic.title === "General") <= -1
|
||||
) {
|
||||
notebook.topics.splice(0, 0, "General");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user