fix: adding topics to existing notebook

This commit is contained in:
ammarahm-ed
2020-01-10 18:45:08 +05:00
parent dc24b58231
commit aa7ed4a830

View File

@@ -99,20 +99,22 @@ export const AddNotebookDialog = ({visible, close, toEdit = null}) => {
if (!title)
return ToastEvent.show('Title is required', 'error', 3000, () => {}, '');
let dateCreated = toEdit && toEdit.dateCreated ? toEdit.dateCreated : null;
await db.addNotebook({
title,
description,
topics,
timestamp: toEdit && toEdit.dateCreated ? toEdit.dateCreated : null,
dateCreated: dateCreated,
});
ToastEvent.show('New notebook added', 'success', 3000, () => {}, '');
setTopics(['']);
prevIndex = null;
prevItem = null;
currentSelectedInput = null;
refs = [];
setTopics(['']);
close(true);
ToastEvent.show('New notebook added', 'success', 3000, () => {}, '');
};
onKeyPress = (event, index, text) => {