sync fixed

This commit is contained in:
life
2018-12-03 13:27:00 +08:00
parent d683c69707
commit 215549e5ea
2 changed files with 7 additions and 8 deletions

2
node_modules/api.js generated vendored
View File

@@ -234,7 +234,7 @@ var Api = {
if(Common.isOk(ret)) { // {Content: 'xx', NoteId: 'xxx'}
callback && callback(ret);
} else {
callback && callback(false);
callback && callback(false, ret);
}
});
},

13
node_modules/note.js generated vendored
View File

@@ -670,8 +670,8 @@ var Note = {
me.inSyncTimes[noteId] = 0
}
me.inSyncTimes[noteId]++;
if(me.inSyncTimes[noteId] > 5) {
callback && callback(false);
if(me.inSyncTimes[noteId] >= 5) {
return callback && callback(false);
}
me.getNote(noteId, function(note) {
@@ -700,12 +700,11 @@ var Note = {
return callback && callback(false);
}
Api.getNoteContent(serverNoteId, function(noteContent) {
Api.getNoteContent(serverNoteId, function(noteContent, ret) {
me.inSyncContent[noteId] = false;
// 同步到本地
if(Common.isOk(noteContent)) {
me.updateNoteContentForce(noteId, noteContent.Content, function(content) {
noteContent.Content = content;
noteContent.NoteId = noteId;
@@ -714,12 +713,12 @@ var Note = {
} else {
// 没有登录或者需要升级
try {
if (noteContent.Ok === false) { // {"Ok":false,"Msg":"NOTLOGIN"}
return callback(false)
if (ret.Ok === false) { // {"Ok":false,"Msg":"NOTLOGIN"}
console.error(ret)
return callback && callback(false)
}
} catch(e) {
}
console.error(noteId + ' api.getNoteContent error');
// 这里, 可能太多的要同步了