diff --git a/lib/client/dom.js b/lib/client/dom.js index fbd2c919..836fc545 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -1758,20 +1758,25 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; */ this.saveDataToCache = function(name, data, callback) { CloudCmd.getConfig(function(config) { - var allowed = config.localStorage; + var cacheName, + allowed = config.localStorage; if (!allowed) Util.exec(callback); else { - Cache.set(name + '-data', data); - DOM.loadCurrentHash(function(hash) { - var isContain = Util.isContainStr(hash, 'error'); - - if (!isContain) - Cache.set(name + '-hash', hash); - - Util.exec(callback, hash); - }); + cacheName = name + '-data'; + + if (!!Cache.get(cacheName)) { + Cache.set(cacheName, data); + DOM.loadCurrentHash(function(hash) { + var isContain = Util.isContainStr(hash, 'error'); + + if (!isContain) + Cache.set(name + '-hash', hash); + + Util.exec(callback, hash); + }); + } } }); };