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) 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) => {