mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
fix(dom) saveDataToStorage, getDataFromStorage: localStorage option check (#177)
This commit is contained in:
parent
a5c7db711c
commit
55488ae292
1 changed files with 2 additions and 4 deletions
|
|
@ -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([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue