同步内容的操作只在前端发起, 每个有800ms间隔

https://github.com/leanote/desktop-app/issues/85
This commit is contained in:
life
2015-11-24 12:27:09 +08:00
parent 0f881c8e77
commit a60eb213d8
2 changed files with 107 additions and 28 deletions

18
node_modules/note.js generated vendored
View File

@@ -636,7 +636,7 @@ var Note = {
inSyncTimes: {}, // 10次就要再尝试了
getNoteContent: function(noteId, callback) {
var me = this;
console.log('getNoteContent------' + noteId);
// console.trace('getNoteContent------' + noteId);
// 如果是正在sync的话, 返回
/*
if(me.inSyncContent[noteId]) {
@@ -777,6 +777,7 @@ var Note = {
});
});
},
// 添加笔记本, note object
// note是服务器传过来的, 需要处理下fix
// NoteId, ServerNoteId, NotebookId(本地的)
@@ -831,7 +832,8 @@ var Note = {
Notebook.reCountNotebookNumberNotes(note.NotebookId);
// 下载内容, 图片, 附件
me.syncContentAndImagesAndAttachs(newDoc, 2000);
// 添加时不要, 这个请求由前端发出
// me.syncContentAndImagesAndAttachs(newDoc, 2000);
}
});
});
@@ -924,13 +926,13 @@ var Note = {
Notebook.getNotebookIdByServerNotebookId(note.NotebookId, function(localNotebookId) {
note['NotebookId'] = localNotebookId;
console.log("updateNoteForce 后的")
console.log(note);
console.log(note.ServerNoteId + " " + note.IsDirty);
// console.log("updateNoteForce 后的")
// console.log(note);
// console.log(note.ServerNoteId + " " + note.IsDirty);
console.log('ever note');
console.log(everNote.NoteId);
console.log(everNote);
// console.log('ever note');
// console.log(everNote.NoteId);
// console.log(everNote);
// 不要服务器上的
delete note['UpdatedTime'];