Skip to content

Commit 510b125

Browse files
committed
Fix new note with empty content not saving to history and remove debug code
1 parent bc74c1f commit 510b125

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/history.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ function setHistory(userid, history) {
113113
}
114114

115115
function updateHistory(userid, noteId, document) {
116-
var t0 = new Date().getTime();
117-
if (userid && noteId && document) {
116+
if (userid && noteId && typeof document !== 'undefined') {
118117
getHistory(userid, function (err, history) {
119118
if (err || !history) return;
120119
if (!caches[userid].history[noteId]) {
@@ -127,8 +126,6 @@ function updateHistory(userid, noteId, document) {
127126
noteHistory.time = moment().format('MMMM Do YYYY, h:mm:ss a');
128127
noteHistory.tags = noteInfo.tags;
129128
caches[userid].isDirty = true;
130-
var t1 = new Date().getTime();
131-
console.warn(t1 - t0);
132129
});
133130
}
134131
}

0 commit comments

Comments
 (0)