mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-14 07:00:53 +00:00
full sync fix
This commit is contained in:
11
node_modules/user.js
generated
vendored
11
node_modules/user.js
generated
vendored
@@ -442,7 +442,8 @@ User = {
|
||||
fullSyncForce: function(callback) {
|
||||
var me = this;
|
||||
var userId = me.getCurActiveUserId();
|
||||
db.users.update({UserId: userId}, {$set: {LastSyncUsn: -1, NotebookUsn: -1, NoteUsn: -1, TagUsn: -1}}, function() {
|
||||
// 设为HasDB为true
|
||||
db.users.update({UserId: userId}, {$set: {HasDB: true, LastSyncUsn: -1, NotebookUsn: -1, NoteUsn: -1, TagUsn: -1}}, function() {
|
||||
// 删除本地账户所有数据
|
||||
me.deleteUserAllData(userId, function () {
|
||||
callback && callback();
|
||||
@@ -640,7 +641,7 @@ User = {
|
||||
var me = this;
|
||||
|
||||
// 判断当前db是否是全局的, 如果不是, 则初始化全局的
|
||||
var names = ['notebooks', 'notes', 'tags', 'images', 'attachs', 'noteHistories'];
|
||||
var names = ['notebooks', 'notes', 'tags',/* 'images',*/ 'attachs', 'noteHistories'];
|
||||
var sourceDb = {};
|
||||
if (me.hasDB) {
|
||||
db.initIt(sourceDb, names, '', false);
|
||||
@@ -649,7 +650,7 @@ User = {
|
||||
sourceDb = db;
|
||||
}
|
||||
|
||||
var names = ['notebooks', 'notes', 'tags', 'images', 'attachs'];
|
||||
var names = ['notebooks', 'notes', 'tags', /*'images', */'attachs'];
|
||||
var query = {UserId: userId};
|
||||
|
||||
if (!async) {
|
||||
@@ -671,12 +672,12 @@ User = {
|
||||
}
|
||||
|
||||
// 删除历史记录
|
||||
me._deleteNoteHistories(sourceDb, docs, function () {
|
||||
// me._deleteNoteHistories(sourceDb, docs, function () {
|
||||
// 删除自己
|
||||
dbIt.remove(query, { multi: true },function () {
|
||||
cb();
|
||||
});
|
||||
});
|
||||
// });
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user