Skip to content

Commit

Permalink
Fix new note with empty content not saving to history and remove debu…
Browse files Browse the repository at this point in the history
…g code
  • Loading branch information
jackycute committed Oct 10, 2016
1 parent bc74c1f commit 510b125
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand All @@ -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);
});
}
}
Expand Down

0 comments on commit 510b125

Please sign in to comment.