mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
fix creating new notebook
This commit is contained in:
@@ -158,7 +158,8 @@ export class AddNotebookDialog extends React.Component {
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (notesnook) {
|
||||
let toEdit = null;
|
||||
if (notebook) {
|
||||
toEdit = db.notebooks.notebook(notebook.id).data;
|
||||
}
|
||||
|
||||
@@ -172,7 +173,8 @@ export class AddNotebookDialog extends React.Component {
|
||||
this.currentInputValue = null;
|
||||
}
|
||||
}
|
||||
if (notesnook) {
|
||||
|
||||
if (notebook) {
|
||||
if (this.topicsToDelete?.length > 0) {
|
||||
await db.notebooks
|
||||
.notebook(toEdit.id)
|
||||
@@ -203,7 +205,8 @@ export class AddNotebookDialog extends React.Component {
|
||||
await db.notebooks.add({
|
||||
title: this.title,
|
||||
description: this.description,
|
||||
topics: prevTopics
|
||||
topics: prevTopics,
|
||||
id:null
|
||||
});
|
||||
}
|
||||
useMenuStore.getState().setMenuPins();
|
||||
@@ -286,7 +289,7 @@ export class AddNotebookDialog extends React.Component {
|
||||
descFocused: false,
|
||||
titleFocused: false,
|
||||
editTopic: false,
|
||||
notesnook: null
|
||||
notebook: null
|
||||
});
|
||||
}}
|
||||
statusBarTranslucent={false}
|
||||
|
||||
Reference in New Issue
Block a user