mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
fix(dom) getCurrentData
This commit is contained in:
parent
cc76eb9d2b
commit
b8592d35c0
1 changed files with 1 additions and 25 deletions
|
|
@ -3,7 +3,6 @@
|
|||
'use strict';
|
||||
|
||||
const itype = require('itype/legacy');
|
||||
const exec = require('execon');
|
||||
const jonny = require('jonny/legacy');
|
||||
const tryToPromiseAll = require('../../common/try-to-promise-all');
|
||||
|
||||
|
|
@ -340,7 +339,7 @@ function CmdProto() {
|
|||
const [hashNew, hash] = await DOM.checkStorageHash(path);
|
||||
|
||||
if (hash === hashNew)
|
||||
return await DOM.getDataFromStorage(path);
|
||||
return await Storage.get(`${path}-data`);
|
||||
|
||||
let [e, data] = await RESTful.read(path);
|
||||
|
||||
|
|
@ -563,29 +562,6 @@ function CmdProto() {
|
|||
return hash;
|
||||
};
|
||||
|
||||
/**
|
||||
* save data to storage
|
||||
*
|
||||
* @param name
|
||||
* @param data
|
||||
* @param callback
|
||||
*/
|
||||
this.getDataFromStorage = callbackify(async (name, callback) => {
|
||||
const nameHash = name + '-hash';
|
||||
const nameData = name + '-data';
|
||||
const isDir = DOM.isCurrentIsDir();
|
||||
|
||||
if (isDir)
|
||||
return exec(callback);
|
||||
|
||||
const result = Promise.all([
|
||||
await Storage.get(nameData),
|
||||
await Storage.get(nameHash),
|
||||
]);
|
||||
|
||||
return result;
|
||||
});
|
||||
|
||||
this.getFM = () => {
|
||||
return DOM.getPanel().parentElement;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue