summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorWu Cheng-Han2016-10-11 01:22:08 +0800
committerWu Cheng-Han2016-10-11 01:22:08 +0800
commit510b1254323ad03a2ac21a93a4450d7fb67ab9a8 (patch)
tree5b7282107d2912963dd23c7d682ba2f3f2234ca4 /lib
parentbc74c1f0cb4e146d7944cea37fb1afbe6772fd71 (diff)
Fix new note with empty content not saving to history and remove debug code
Diffstat (limited to 'lib')
-rw-r--r--lib/history.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/history.js b/lib/history.js
index 119b7510..c3754e0b 100644
--- a/lib/history.js
+++ b/lib/history.js
@@ -113,8 +113,7 @@ function setHistory(userid, history) {
}
function updateHistory(userid, noteId, document) {
- var t0 = new Date().getTime();
- if (userid && noteId && document) {
+ if (userid && noteId && typeof document !== 'undefined') {
getHistory(userid, function (err, history) {
if (err || !history) return;
if (!caches[userid].history[noteId]) {
@@ -127,8 +126,6 @@ function updateHistory(userid, noteId, document) {
noteHistory.time = moment().format('MMMM Do YYYY, h:mm:ss a');
noteHistory.tags = noteInfo.tags;
caches[userid].isDirty = true;
- var t1 = new Date().getTime();
- console.warn(t1 - t0);
});
}
}