mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-15 07:31:33 +00:00
sync fixed
This commit is contained in:
2
node_modules/api.js
generated
vendored
2
node_modules/api.js
generated
vendored
@@ -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
13
node_modules/note.js
generated
vendored
@@ -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');
|
||||
|
||||
// 这里, 可能太多的要同步了
|
||||
|
Reference in New Issue
Block a user