mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-16 08:01:53 +00:00
send changes note.delete [ok]
TODO: 图片/attach的同步
This commit is contained in:
16
node_modules/sync.js
generated
vendored
16
node_modules/sync.js
generated
vendored
@@ -528,15 +528,6 @@ var Sync = {
|
||||
// 调api, 所有执行后再callback();
|
||||
// 一个一个同步执行, 因为要有
|
||||
async.eachSeries(notes, function(note, cb) {
|
||||
/*
|
||||
var api = Api.updateNote;
|
||||
if(note.LocalIsNew) {
|
||||
api = Api.addNote;
|
||||
} else if(note.LocalIsDelete) {
|
||||
api = Api.deleteNote;
|
||||
}
|
||||
*/
|
||||
|
||||
if(note.LocalIsNew) {
|
||||
// 添加
|
||||
Api.addNote(note, function(newNote) {
|
||||
@@ -558,9 +549,10 @@ var Sync = {
|
||||
// 删除, 不管它了
|
||||
// TODO
|
||||
Api.deleteTrash(note, function(ret) {
|
||||
if(!Common.isOk(ret)) {
|
||||
return cb();
|
||||
if(Common.isOk(ret)) {
|
||||
me.checkNeedIncSyncAgain(ret.Usn);
|
||||
}
|
||||
return cb();
|
||||
});
|
||||
} else {
|
||||
// 更新
|
||||
@@ -581,7 +573,7 @@ var Sync = {
|
||||
Note.updateNoteForceForSendChange({NoteId: note.NoteId, Usn: ret.Usn});
|
||||
|
||||
me.checkNeedIncSyncAgain(ret.Usn);
|
||||
|
||||
|
||||
return cb();
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user