send changes note.delete [ok]

TODO: 图片/attach的同步
This commit is contained in:
life
2015-01-27 00:14:34 +08:00
parent 218671f53a
commit 75d2710e05
5 changed files with 42 additions and 17 deletions

16
node_modules/sync.js generated vendored
View File

@@ -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();
});
}