Commit 510b1254 authored by Wu Cheng-Han's avatar Wu Cheng-Han
Browse files

Fix new note with empty content not saving to history and remove debug code

parent bc74c1f0
......@@ -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);
});
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment