全量同步会先删除本地所有数据, 再重新同步

This commit is contained in:
life
2015-11-21 17:17:14 +08:00
parent 2f5eaf0a56
commit 7d452dceef
4 changed files with 10 additions and 6 deletions

8
node_modules/user.js generated vendored
View File

@@ -378,9 +378,13 @@ User = {
// 设为-1, 再刷新就会重新同步
fullSyncForce: function(callback) {
var me = this;
db.users.update({UserId: me.getCurActiveUserId()}, {$set: {LastSyncUsn: -1}}, function() {
var userId = me.getCurActiveUserId();
db.users.update({UserId: userId}, {$set: {LastSyncUsn: -1}}, function() {
// 删除本地账户所有数据
me.deleteUserAllData(userId, function () {
callback && callback();
});
});
},
// 同步后更新同步状态
@@ -530,7 +534,7 @@ User = {
// 1. 删除附件,图片
me.deleteUserImagesAndAttachsPath(userId);
// 3. 删除其它表
// 2. 删除数据库
// 如果有自己独立的表, 则把文件夹删除即可
if (userInfo.HasDB) {
var dbPath = me.getUserDBPath(userId);

View File

@@ -184,5 +184,5 @@
"Tag": "Tag",
"Starred": "Starred",
"ForceFullSyncMsg": "Full sync will load all data from server, are you sure ?"
"ForceFullSyncMsg": "Full sync will remove the current account's all local data (includes database, images and attachments) and load all data from server, are you sure ?"
}

View File

@@ -263,7 +263,7 @@
"More...": "更多",
"Force full sync": "强制全量同步",
"ForceFullSyncMsg": "强制全量同步会从服务器上同步所有数据, 可能耗时比较久, 你确定?",
"ForceFullSyncMsg": "强制全量同步会先将该帐户的本地数据全部删除(包括数据库, 图片和附件), 然后从服务器上同步所有数据, 你确定?",
"Are you sure to delete it ?": "确定删除?",
"Are you sure ?": "你确定执行该操作?",

View File

@@ -263,7 +263,7 @@
"More...": "更多",
"Force full sync": "強制全量同步",
"ForceFullSyncMsg": "強制全量同步會從服務器上同步所有數據, 可能耗時比較久, 妳確定?",
"ForceFullSyncMsg": "強制全量同步會先將該帳戶的本地數據全部刪除(包括數據庫, 圖片和附件), 然後從服務器上同步所有數據, 妳確定?",
"Are you sure to delete it ?": "確定刪除?",
"Are you sure ?": "妳確定執行該操作?",