mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-15 15:41:19 +00:00
presentation, fullscreen toggle; user state; animation loading;
This commit is contained in:
27
node_modules/sync.js
generated
vendored
27
node_modules/sync.js
generated
vendored
@@ -88,6 +88,21 @@ var Sync = {
|
||||
me._needIncrSyncAgain = false;
|
||||
},
|
||||
|
||||
// 停止同步
|
||||
_stop: false,
|
||||
stop: function() {
|
||||
var me = this;
|
||||
me._stop = true;
|
||||
},
|
||||
isStop: function() {
|
||||
var me = this;
|
||||
if(me._stop) {
|
||||
me._stop = false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
//---------------
|
||||
// notebook
|
||||
//---------------
|
||||
@@ -108,6 +123,7 @@ var Sync = {
|
||||
// 同步笔记本
|
||||
_syncNotebookToLocal: function(notebooks, callback) {
|
||||
var me = this;
|
||||
|
||||
function canCall() {
|
||||
// 是最后一块, 且
|
||||
me._addSyncNotebookNum();
|
||||
@@ -183,6 +199,9 @@ var Sync = {
|
||||
|
||||
syncNotebook: function(afterUsn, callback) {
|
||||
var me = this;
|
||||
if(me.isStop()) {
|
||||
return;
|
||||
}
|
||||
Api.getSyncNotebooks(afterUsn, me._notebookMaxEntry, function(notebooks) {
|
||||
console.log('syncNotebook')
|
||||
console.log(notebooks);
|
||||
@@ -228,6 +247,7 @@ var Sync = {
|
||||
// 同步笔记到本地
|
||||
_syncNoteToLocal: function(notes, callback) {
|
||||
var me = this;
|
||||
|
||||
function canCall(isEmpty) {
|
||||
// 为空时来判断是最后一次了, 可以之前的还没处理完
|
||||
if(isEmpty && me._totalHasSyncNoteNum < me._totalSyncNoteNum) {
|
||||
@@ -313,6 +333,10 @@ var Sync = {
|
||||
|
||||
syncNote: function(afterUsn, callback) {
|
||||
var me = this;
|
||||
if(me.isStop()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Api.getSyncNotes(afterUsn, me._noteMaxEntry, function(notes) {
|
||||
log('syncNote')
|
||||
log(notes);
|
||||
@@ -423,6 +447,9 @@ var Sync = {
|
||||
},
|
||||
syncTag: function(afterUsn, callback) {
|
||||
var me = this;
|
||||
if(me.isStop()) {
|
||||
return;
|
||||
}
|
||||
Api.getSyncTags(afterUsn, me._tagMaxEntry, function(tags) {
|
||||
log('syncTags------------------------------------')
|
||||
log(tags);
|
||||
|
Reference in New Issue
Block a user