From 85a164f7c186426c7545e0ff78f80951b9724fc8 Mon Sep 17 00:00:00 2001 From: life Date: Sat, 21 Jan 2017 11:57:39 +0800 Subject: [PATCH] Not need to render at Full sync --- node_modules/sync.js | 4 ++++ node_modules/web.js | 56 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/node_modules/sync.js b/node_modules/sync.js index 4d345894..40f164d5 100644 --- a/node_modules/sync.js +++ b/node_modules/sync.js @@ -654,6 +654,9 @@ var Sync = { // mainType == notebook, note, tag // type = changeAdds, changeConflicts, adds, deletes, updates, conflicts, errors, fixSynced: function (mainType, type, data) { + if (this.fullSyncStart) { + return; + } var o = {}; if (!Common.isArray(data)) { data = [data]; @@ -738,6 +741,7 @@ var Sync = { setSyncFinished: function(hasError) { var me = this; me.incrSyncStart = false; + me.fullSyncStart = false; // Web.syncProgress(0); Web.syncFinished(hasError); }, diff --git a/node_modules/web.js b/node_modules/web.js index 5998fcd3..a5e554e6 100644 --- a/node_modules/web.js +++ b/node_modules/web.js @@ -40,26 +40,44 @@ var Web = { }, reloadNotebook: function () { + if (SyncService.fullSyncStart) { + return; + } this.Notebook.reload(); }, addSyncNotebook: function(notebooks) { + if (SyncService.fullSyncStart) { + return; + } var me = this; me.Notebook.addSync(notebooks); }, updateSyncNotebook: function(notebooks) { + if (SyncService.fullSyncStart) { + return; + } var me = this; me.Notebook.updateSync(notebooks); }, deleteSyncNotebook: function(notebooks) { + if (SyncService.fullSyncStart) { + return; + } var me = this; me.Notebook.deleteSync(notebooks); }, addChangeNotebook: function(notebooks) { + if (SyncService.fullSyncStart) { + return; + } var me = this; me.Notebook.addChanges(notebooks); }, updateChangeNotebook: function (notebooks) { + if (SyncService.fullSyncStart) { + return; + } this.Notebook.updateChanges(notebooks); }, /* @@ -71,10 +89,16 @@ var Web = { //---------- addSyncNote: function(notes) { + if (SyncService.fullSyncStart) { + return; + } var me = this; me.Note.addSync(notes); }, updateSyncNote: function(notes) { + if (SyncService.fullSyncStart) { + return; + } var me = this; me.Note.updateSync(notes); }, @@ -83,22 +107,37 @@ var Web = { me.Note.updateErrors(notes); }, updateChangeUpdates: function (notes) { + if (SyncService.fullSyncStart) { + return; + } var me = this; me.Note.updateChangeUpdates(notes); }, updateChangeAdds: function (notes) { + if (SyncService.fullSyncStart) { + return; + } var me = this; me.Note.updateChangeAdds(notes); }, deleteSyncNote: function(notes) { + if (SyncService.fullSyncStart) { + return; + } var me = this; me.Note.deleteSync(notes); }, fixSyncConflictNote: function(note, newNote) { + if (SyncService.fullSyncStart) { + return; + } var me = this; me.Note.fixSyncConflict(note, newNote); }, updateNoteCacheForServer: function(notes) { + if (SyncService.fullSyncStart) { + return; + } var me = this; me.Note.updateNoteCacheForServer(notes); }, @@ -118,6 +157,9 @@ var Web = { // addOrDeleteTagFromSync: function(tagSyncInfo) { + if (SyncService.fullSyncStart) { + return; + } var me = this; // console.log("是啊"); // console.error(tagSyncInfo); @@ -127,13 +169,19 @@ var Web = { me.Tag.nav.deleteTags(deletes); }, - addTag: function(tag) { + addTag: function(tag) { + if (SyncService.fullSyncStart) { + return; + } var me = this; me.Tag.addTagNav(tag); }, // 内容同步成功 contentSynced: function(noteId, content) { + if (SyncService.fullSyncStart) { + return; + } var me = this; if(noteId) { me.Note.contentSynced(noteId, content); @@ -142,6 +190,9 @@ var Web = { // 通过attach已同步成功 attachSynced: function(attachs, attach, noteId) { + if (SyncService.fullSyncStart) { + return; + } var me = this; me.Attach.attachSynced(attachs, attach, noteId); }, @@ -175,6 +226,9 @@ var Web = { // 重新统计后, 显示到web上 updateNotebookNumberNotes: function(notebookId, count) { + if (SyncService.fullSyncStart) { + return; + } var me = this; me.Notebook && me.Notebook.updateNotebookNumberNotes(notebookId, count); }