修改展示不及时问题

This commit is contained in:
暮光:城中城
2018-12-15 22:46:41 +08:00
parent d1ab3b8a88
commit 204ba15e11
2 changed files with 14 additions and 5 deletions

View File

@@ -101,13 +101,15 @@
watch: {
catalogShowType: function(newVal, oldval){
app.userSettings.catalogShowType = newVal;
storeUserSettings();
getExport().regeneratePathTree();
storeUserSettings(function(){
getExport().regeneratePathTree();
});
},
treeShowType: function(newVal, oldval){
app.userSettings.treeShowType = newVal;
storeUserSettings();
window.parent.window.updateTreeShowType();
storeUserSettings(function(){
getExport().updateTreeShowType();
});
},
showParamType: function(newVal, oldval){
app.userSettings.showParamType = newVal;
@@ -125,10 +127,13 @@
});
// 存储用户的配置信息
function storeUserSettings() {
function storeUserSettings(success) {
if (app.initCount-- <= 0) {
setStorage(cacheKeys.userSettings, app.userSettings, function () {
getExport().updateUserSettings(app.userSettings);
if(typeof success == "function") {
success();
}
});
}
}