mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 22:49:45 +01:00
fix: adding topics to existing notebook
This commit is contained in:
@@ -99,20 +99,22 @@ export const AddNotebookDialog = ({visible, close, toEdit = null}) => {
|
|||||||
if (!title)
|
if (!title)
|
||||||
return ToastEvent.show('Title is required', 'error', 3000, () => {}, '');
|
return ToastEvent.show('Title is required', 'error', 3000, () => {}, '');
|
||||||
|
|
||||||
|
let dateCreated = toEdit && toEdit.dateCreated ? toEdit.dateCreated : null;
|
||||||
|
|
||||||
await db.addNotebook({
|
await db.addNotebook({
|
||||||
title,
|
title,
|
||||||
description,
|
description,
|
||||||
topics,
|
topics,
|
||||||
timestamp: toEdit && toEdit.dateCreated ? toEdit.dateCreated : null,
|
dateCreated: dateCreated,
|
||||||
});
|
});
|
||||||
|
|
||||||
ToastEvent.show('New notebook added', 'success', 3000, () => {}, '');
|
|
||||||
setTopics(['']);
|
|
||||||
prevIndex = null;
|
prevIndex = null;
|
||||||
prevItem = null;
|
prevItem = null;
|
||||||
currentSelectedInput = null;
|
currentSelectedInput = null;
|
||||||
refs = [];
|
refs = [];
|
||||||
|
setTopics(['']);
|
||||||
close(true);
|
close(true);
|
||||||
|
ToastEvent.show('New notebook added', 'success', 3000, () => {}, '');
|
||||||
};
|
};
|
||||||
|
|
||||||
onKeyPress = (event, index, text) => {
|
onKeyPress = (event, index, text) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user