fix(dom) saveDataToStorage, getDataFromStorage: localStorage option check (#177)

This commit is contained in:
coderaiser 2018-06-09 11:37:41 +03:00
parent a5c7db711c
commit 55488ae292

View file

@ -582,12 +582,11 @@ function CmdProto() {
* @param callback
*/
this.saveDataToStorage = function(name, data, hash, callback) {
const allowed = CloudCmd.config('localStorage');
const isDir = DOM.isCurrentIsDir();
const nameHash = name + '-hash';
const nameData = name + '-data';
if (!allowed || isDir)
if (isDir)
return exec(callback);
exec.if(hash, () => {
@ -613,10 +612,9 @@ function CmdProto() {
this.getDataFromStorage = (name, callback) => {
const nameHash = name + '-hash';
const nameData = name + '-data';
const allowed = CloudCmd.config('localStorage');
const isDir = DOM.isCurrentIsDir();
if (!allowed || isDir)
if (isDir)
return exec(callback);
exec.parallel([