mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-17 08:38:18 +00:00
Cannot sync InitSync note to server
This commit is contained in:
6
node_modules/sync.js
generated
vendored
6
node_modules/sync.js
generated
vendored
@@ -906,6 +906,12 @@ var Sync = {
|
|||||||
// 调api, 所有执行后再callback();
|
// 调api, 所有执行后再callback();
|
||||||
// 一个一个同步执行, 因为要有
|
// 一个一个同步执行, 因为要有
|
||||||
async.eachSeries(notes, function(note, cb) {
|
async.eachSeries(notes, function(note, cb) {
|
||||||
|
|
||||||
|
if (note.InitSync) {
|
||||||
|
console.error('InitSync is Dirty');
|
||||||
|
return cb();
|
||||||
|
}
|
||||||
|
|
||||||
if(note.LocalIsNew) {
|
if(note.LocalIsNew) {
|
||||||
// 是新的, 且不是trash和删除的
|
// 是新的, 且不是trash和删除的
|
||||||
if(!note.IsTrash && !note.LocalIsDelete) {
|
if(!note.IsTrash && !note.LocalIsDelete) {
|
||||||
|
@@ -238,7 +238,7 @@ Note.alertWeb = function(msg) {
|
|||||||
// 返回已改变的信息
|
// 返回已改变的信息
|
||||||
Note.curHasChanged = function(force) {
|
Note.curHasChanged = function(force) {
|
||||||
var cacheNote = Note.getCurNote();
|
var cacheNote = Note.getCurNote();
|
||||||
if (!cacheNote) {
|
if (!cacheNote || cacheNote.InitSync) { // 还没有同步的, 不能保存
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// else {
|
// else {
|
||||||
@@ -712,9 +712,14 @@ Note.changeNote = function(selectNoteId, isShare, needSaveChanged, callback) {
|
|||||||
var seq = Note.contentAjaxSeq;
|
var seq = Note.contentAjaxSeq;
|
||||||
|
|
||||||
function setContent(ret, fromCache, seq2) {
|
function setContent(ret, fromCache, seq2) {
|
||||||
if(ret) {
|
// 找不到内容, 就一直loading
|
||||||
cacheNote.InitSync = false;
|
if (!ret) {
|
||||||
|
console.error('取不到内容');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cacheNote.InitSync = false;
|
||||||
|
|
||||||
ret = ret || {};
|
ret = ret || {};
|
||||||
Note.contentAjax = null;
|
Note.contentAjax = null;
|
||||||
if(seq2 != Note.contentAjaxSeq) {
|
if(seq2 != Note.contentAjaxSeq) {
|
||||||
@@ -1811,6 +1816,13 @@ Note.toggleReadOnly = function(needSave) {
|
|||||||
// 切换到编辑模式
|
// 切换到编辑模式
|
||||||
LEA.toggleWriteable = Note.toggleWriteable = function(isFromNewNote) {
|
LEA.toggleWriteable = Note.toggleWriteable = function(isFromNewNote) {
|
||||||
var me = Note;
|
var me = Note;
|
||||||
|
var note = me.getCurNote();
|
||||||
|
if (note) {
|
||||||
|
if (note.InitSync) {
|
||||||
|
alert('Waiting for lading content from server');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// $('#infoToolbar').hide();
|
// $('#infoToolbar').hide();
|
||||||
$('#editor').removeClass('read-only');
|
$('#editor').removeClass('read-only');
|
||||||
@@ -1820,8 +1832,7 @@ LEA.toggleWriteable = Note.toggleWriteable = function(isFromNewNote) {
|
|||||||
// markdown
|
// markdown
|
||||||
$('#mdEditor').removeClass('read-only');
|
$('#mdEditor').removeClass('read-only');
|
||||||
|
|
||||||
var note = me.getCurNote();
|
if (!note) {
|
||||||
if(!note) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user