Not need to render at Full sync

This commit is contained in:
life
2017-01-21 11:57:39 +08:00
parent 6e4a877997
commit 85a164f7c1
2 changed files with 59 additions and 1 deletions

4
node_modules/sync.js generated vendored
View File

@@ -654,6 +654,9 @@ var Sync = {
// mainType == notebook, note, tag // mainType == notebook, note, tag
// type = changeAdds, changeConflicts, adds, deletes, updates, conflicts, errors, // type = changeAdds, changeConflicts, adds, deletes, updates, conflicts, errors,
fixSynced: function (mainType, type, data) { fixSynced: function (mainType, type, data) {
if (this.fullSyncStart) {
return;
}
var o = {}; var o = {};
if (!Common.isArray(data)) { if (!Common.isArray(data)) {
data = [data]; data = [data];
@@ -738,6 +741,7 @@ var Sync = {
setSyncFinished: function(hasError) { setSyncFinished: function(hasError) {
var me = this; var me = this;
me.incrSyncStart = false; me.incrSyncStart = false;
me.fullSyncStart = false;
// Web.syncProgress(0); // Web.syncProgress(0);
Web.syncFinished(hasError); Web.syncFinished(hasError);
}, },

56
node_modules/web.js generated vendored
View File

@@ -40,26 +40,44 @@ var Web = {
}, },
reloadNotebook: function () { reloadNotebook: function () {
if (SyncService.fullSyncStart) {
return;
}
this.Notebook.reload(); this.Notebook.reload();
}, },
addSyncNotebook: function(notebooks) { addSyncNotebook: function(notebooks) {
if (SyncService.fullSyncStart) {
return;
}
var me = this; var me = this;
me.Notebook.addSync(notebooks); me.Notebook.addSync(notebooks);
}, },
updateSyncNotebook: function(notebooks) { updateSyncNotebook: function(notebooks) {
if (SyncService.fullSyncStart) {
return;
}
var me = this; var me = this;
me.Notebook.updateSync(notebooks); me.Notebook.updateSync(notebooks);
}, },
deleteSyncNotebook: function(notebooks) { deleteSyncNotebook: function(notebooks) {
if (SyncService.fullSyncStart) {
return;
}
var me = this; var me = this;
me.Notebook.deleteSync(notebooks); me.Notebook.deleteSync(notebooks);
}, },
addChangeNotebook: function(notebooks) { addChangeNotebook: function(notebooks) {
if (SyncService.fullSyncStart) {
return;
}
var me = this; var me = this;
me.Notebook.addChanges(notebooks); me.Notebook.addChanges(notebooks);
}, },
updateChangeNotebook: function (notebooks) { updateChangeNotebook: function (notebooks) {
if (SyncService.fullSyncStart) {
return;
}
this.Notebook.updateChanges(notebooks); this.Notebook.updateChanges(notebooks);
}, },
/* /*
@@ -71,10 +89,16 @@ var Web = {
//---------- //----------
addSyncNote: function(notes) { addSyncNote: function(notes) {
if (SyncService.fullSyncStart) {
return;
}
var me = this; var me = this;
me.Note.addSync(notes); me.Note.addSync(notes);
}, },
updateSyncNote: function(notes) { updateSyncNote: function(notes) {
if (SyncService.fullSyncStart) {
return;
}
var me = this; var me = this;
me.Note.updateSync(notes); me.Note.updateSync(notes);
}, },
@@ -83,22 +107,37 @@ var Web = {
me.Note.updateErrors(notes); me.Note.updateErrors(notes);
}, },
updateChangeUpdates: function (notes) { updateChangeUpdates: function (notes) {
if (SyncService.fullSyncStart) {
return;
}
var me = this; var me = this;
me.Note.updateChangeUpdates(notes); me.Note.updateChangeUpdates(notes);
}, },
updateChangeAdds: function (notes) { updateChangeAdds: function (notes) {
if (SyncService.fullSyncStart) {
return;
}
var me = this; var me = this;
me.Note.updateChangeAdds(notes); me.Note.updateChangeAdds(notes);
}, },
deleteSyncNote: function(notes) { deleteSyncNote: function(notes) {
if (SyncService.fullSyncStart) {
return;
}
var me = this; var me = this;
me.Note.deleteSync(notes); me.Note.deleteSync(notes);
}, },
fixSyncConflictNote: function(note, newNote) { fixSyncConflictNote: function(note, newNote) {
if (SyncService.fullSyncStart) {
return;
}
var me = this; var me = this;
me.Note.fixSyncConflict(note, newNote); me.Note.fixSyncConflict(note, newNote);
}, },
updateNoteCacheForServer: function(notes) { updateNoteCacheForServer: function(notes) {
if (SyncService.fullSyncStart) {
return;
}
var me = this; var me = this;
me.Note.updateNoteCacheForServer(notes); me.Note.updateNoteCacheForServer(notes);
}, },
@@ -118,6 +157,9 @@ var Web = {
// //
addOrDeleteTagFromSync: function(tagSyncInfo) { addOrDeleteTagFromSync: function(tagSyncInfo) {
if (SyncService.fullSyncStart) {
return;
}
var me = this; var me = this;
// console.log("是啊"); // console.log("是啊");
// console.error(tagSyncInfo); // console.error(tagSyncInfo);
@@ -127,13 +169,19 @@ var Web = {
me.Tag.nav.deleteTags(deletes); me.Tag.nav.deleteTags(deletes);
}, },
addTag: function(tag) { addTag: function(tag) {
if (SyncService.fullSyncStart) {
return;
}
var me = this; var me = this;
me.Tag.addTagNav(tag); me.Tag.addTagNav(tag);
}, },
// 内容同步成功 // 内容同步成功
contentSynced: function(noteId, content) { contentSynced: function(noteId, content) {
if (SyncService.fullSyncStart) {
return;
}
var me = this; var me = this;
if(noteId) { if(noteId) {
me.Note.contentSynced(noteId, content); me.Note.contentSynced(noteId, content);
@@ -142,6 +190,9 @@ var Web = {
// 通过attach已同步成功 // 通过attach已同步成功
attachSynced: function(attachs, attach, noteId) { attachSynced: function(attachs, attach, noteId) {
if (SyncService.fullSyncStart) {
return;
}
var me = this; var me = this;
me.Attach.attachSynced(attachs, attach, noteId); me.Attach.attachSynced(attachs, attach, noteId);
}, },
@@ -175,6 +226,9 @@ var Web = {
// 重新统计后, 显示到web上 // 重新统计后, 显示到web上
updateNotebookNumberNotes: function(notebookId, count) { updateNotebookNumberNotes: function(notebookId, count) {
if (SyncService.fullSyncStart) {
return;
}
var me = this; var me = this;
me.Notebook && me.Notebook.updateNotebookNumberNotes(notebookId, count); me.Notebook && me.Notebook.updateNotebookNumberNotes(notebookId, count);
} }