mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-16 08:01:53 +00:00
删除笔记时, 删除历史记录
This commit is contained in:
10
node_modules/note.js
generated
vendored
10
node_modules/note.js
generated
vendored
@@ -222,6 +222,12 @@ var Note = {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 删除笔记时, 删除历史记录
|
||||||
|
deleteNoteHistory: function (noteId) {
|
||||||
|
db.noteHistories.remove({_id: noteId});
|
||||||
|
},
|
||||||
|
|
||||||
// 获取笔记历史记录
|
// 获取笔记历史记录
|
||||||
getNoteHistories: function(noteId, callback) {
|
getNoteHistories: function(noteId, callback) {
|
||||||
var me = this;
|
var me = this;
|
||||||
@@ -379,6 +385,8 @@ var Note = {
|
|||||||
// TODO 删除附件
|
// TODO 删除附件
|
||||||
db.notes.update({_id: note._id}, {$set: {IsDirty: true, LocalIsDelete: true}}, function(err, n) {
|
db.notes.update({_id: note._id}, {$set: {IsDirty: true, LocalIsDelete: true}}, function(err, n) {
|
||||||
if(n) {
|
if(n) {
|
||||||
|
// 删除历史记录
|
||||||
|
me.deleteNoteHistory(note.NoteId);
|
||||||
// 如果有tags, 则重新更新tags' count
|
// 如果有tags, 则重新更新tags' count
|
||||||
me.updateTagCount(note.Tags);
|
me.updateTagCount(note.Tags);
|
||||||
callback(true);
|
callback(true);
|
||||||
@@ -694,6 +702,8 @@ var Note = {
|
|||||||
if(err) {
|
if(err) {
|
||||||
callback && callback(false);
|
callback && callback(false);
|
||||||
} else {
|
} else {
|
||||||
|
// 删除历史记录
|
||||||
|
me.deleteNoteHistory(noteId);
|
||||||
Notebook.reCountNotebookNumberNotes(note.NotebookId);
|
Notebook.reCountNotebookNumberNotes(note.NotebookId);
|
||||||
callback && callback(true);
|
callback && callback(true);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user