mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-21 14:09:34 +01:00
fix topic not adding
This commit is contained in:
@@ -38,7 +38,8 @@ export class AddTopicDialog extends React.Component {
|
|||||||
return ToastEvent.show('Title is required', 'error', 'local');
|
return ToastEvent.show('Title is required', 'error', 'local');
|
||||||
|
|
||||||
if (!this.props.toEdit) {
|
if (!this.props.toEdit) {
|
||||||
await db.notebooks.notebook(this.props.notebookID).topics.add(this.title);
|
await db.notebooks.notebook(this.notebook.id).topics.add(this.title);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
let topic = this.props.toEdit;
|
let topic = this.props.toEdit;
|
||||||
topic.title = this.title;
|
topic.title = this.title;
|
||||||
@@ -61,7 +62,8 @@ export class AddTopicDialog extends React.Component {
|
|||||||
|
|
||||||
open = async (notebookId) => {
|
open = async (notebookId) => {
|
||||||
let id = notebookId || this.props.notebookID;
|
let id = notebookId || this.props.notebookID;
|
||||||
this.notebook = await db.notebooks.notebook(id);
|
console.log(notebookId)
|
||||||
|
this.notebook = await db.notebooks.notebook(id).data
|
||||||
this.setState({
|
this.setState({
|
||||||
visible: true,
|
visible: true,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user