mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-16 16:04:56 +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'}
|
if(Common.isOk(ret)) { // {Content: 'xx', NoteId: 'xxx'}
|
||||||
callback && callback(ret);
|
callback && callback(ret);
|
||||||
} else {
|
} 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] = 0
|
||||||
}
|
}
|
||||||
me.inSyncTimes[noteId]++;
|
me.inSyncTimes[noteId]++;
|
||||||
if(me.inSyncTimes[noteId] > 5) {
|
if(me.inSyncTimes[noteId] >= 5) {
|
||||||
callback && callback(false);
|
return callback && callback(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
me.getNote(noteId, function(note) {
|
me.getNote(noteId, function(note) {
|
||||||
@@ -700,12 +700,11 @@ var Note = {
|
|||||||
return callback && callback(false);
|
return callback && callback(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Api.getNoteContent(serverNoteId, function(noteContent) {
|
Api.getNoteContent(serverNoteId, function(noteContent, ret) {
|
||||||
me.inSyncContent[noteId] = false;
|
me.inSyncContent[noteId] = false;
|
||||||
|
|
||||||
// 同步到本地
|
// 同步到本地
|
||||||
if(Common.isOk(noteContent)) {
|
if(Common.isOk(noteContent)) {
|
||||||
|
|
||||||
me.updateNoteContentForce(noteId, noteContent.Content, function(content) {
|
me.updateNoteContentForce(noteId, noteContent.Content, function(content) {
|
||||||
noteContent.Content = content;
|
noteContent.Content = content;
|
||||||
noteContent.NoteId = noteId;
|
noteContent.NoteId = noteId;
|
||||||
@@ -714,12 +713,12 @@ var Note = {
|
|||||||
} else {
|
} else {
|
||||||
// 没有登录或者需要升级
|
// 没有登录或者需要升级
|
||||||
try {
|
try {
|
||||||
if (noteContent.Ok === false) { // {"Ok":false,"Msg":"NOTLOGIN"}
|
if (ret.Ok === false) { // {"Ok":false,"Msg":"NOTLOGIN"}
|
||||||
return callback(false)
|
console.error(ret)
|
||||||
|
return callback && callback(false)
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
console.error(noteId + ' api.getNoteContent error');
|
console.error(noteId + ' api.getNoteContent error');
|
||||||
|
|
||||||
// 这里, 可能太多的要同步了
|
// 这里, 可能太多的要同步了
|
||||||
|
Reference in New Issue
Block a user