mirror of
https://github.com/leanote/desktop-app.git
synced 2026-01-28 02:00:56 +08:00
历史记录优化, 不保存一样的历史记录. ctrl+s, ctrl+e, 切换笔记都记历史
This commit is contained in:
7
node_modules/note.js
generated
vendored
7
node_modules/note.js
generated
vendored
@@ -227,6 +227,13 @@ var Note = {
|
||||
// 更新之
|
||||
else {
|
||||
var histories = history.Histories;
|
||||
// 如果与前一个内容一样, 则不加入历史中
|
||||
if (histories
|
||||
&& histories[histories.length - 1].Content
|
||||
&& histories[histories.length - 1].Content == content) {
|
||||
return (callback && callback(true));
|
||||
}
|
||||
|
||||
histories.push({Content: content, UpdatedTime: now});
|
||||
|
||||
// 不能多了, 多了有麻烦, 20个最多
|
||||
|
||||
Reference in New Issue
Block a user