mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-31 19:53:58 +00:00
feature(config) improve speed: decrease config loading count
This commit is contained in:
parent
2769ac2ef5
commit
bbb8ca15c6
16 changed files with 290 additions and 358 deletions
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
function BufferProto(Util, DOM, CloudCmd) {
|
||||
var Storage = DOM.Storage,
|
||||
Files = DOM.Files,
|
||||
Info = DOM.CurrentInfo,
|
||||
json = Util.json,
|
||||
|
||||
|
|
@ -58,22 +57,13 @@
|
|||
});
|
||||
}
|
||||
|
||||
function isEnabled(callback) {
|
||||
Files.get('config', function(error, config) {
|
||||
if (error)
|
||||
showMessage(error);
|
||||
else
|
||||
callback(config.buffer);
|
||||
});
|
||||
}
|
||||
|
||||
function callIfEnabled(callback) {
|
||||
isEnabled(function(is) {
|
||||
if (is)
|
||||
callback();
|
||||
else
|
||||
showMessage('Buffer disabled in config!');
|
||||
});
|
||||
var is = CloudCmd.config('buffer');
|
||||
|
||||
if (is)
|
||||
return callback();
|
||||
|
||||
showMessage('Buffer disabled in config!');
|
||||
}
|
||||
|
||||
function copy() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue