fix topic not adding

This commit is contained in:
ammarahm-ed
2020-12-31 12:28:31 +05:00
parent fb9457086e
commit a7abcfcf18

View File

@@ -38,7 +38,8 @@ export class AddTopicDialog extends React.Component {
return ToastEvent.show('Title is required', 'error', 'local');
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 {
let topic = this.props.toEdit;
topic.title = this.title;
@@ -61,7 +62,8 @@ export class AddTopicDialog extends React.Component {
open = async (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({
visible: true,
});