mirror of https://github.com/status-im/codimd.git
Fix new note with empty content not saving to history and remove debug code
This commit is contained in:
parent
bc74c1f0cb
commit
510b125432
|
@ -113,8 +113,7 @@ function setHistory(userid, history) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateHistory(userid, noteId, document) {
|
function updateHistory(userid, noteId, document) {
|
||||||
var t0 = new Date().getTime();
|
if (userid && noteId && typeof document !== 'undefined') {
|
||||||
if (userid && noteId && document) {
|
|
||||||
getHistory(userid, function (err, history) {
|
getHistory(userid, function (err, history) {
|
||||||
if (err || !history) return;
|
if (err || !history) return;
|
||||||
if (!caches[userid].history[noteId]) {
|
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.time = moment().format('MMMM Do YYYY, h:mm:ss a');
|
||||||
noteHistory.tags = noteInfo.tags;
|
noteHistory.tags = noteInfo.tags;
|
||||||
caches[userid].isDirty = true;
|
caches[userid].isDirty = true;
|
||||||
var t1 = new Date().getTime();
|
|
||||||
console.warn(t1 - t0);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue