chore(dom) getCurrentData: add early return

This commit is contained in:
coderaiser 2017-01-24 12:24:20 +02:00
parent 18ee400d6f
commit d6616c8b76

View file

@ -739,24 +739,24 @@ var CloudCmd, Util, DOM, CloudFunc;
if (Info.name === '..') {
Dialog.alert.noFiles(TITLE);
callback(Error('No files selected!'));
} else if (isDir) {
RESTful.read(path, func);
} else {
DOM.checkStorageHash(path, function(error, equal, hashNew) {
if (error) {
callback(error);
} else if (equal) {
DOM.getDataFromStorage(path, callback);
} else {
hash = hashNew;
RESTful.read(path, func);
}
});
return callback(Error('No files selected!'));
}
if (isDir)
return RESTful.read(path, func);
DOM.checkStorageHash(path, function(error, equal, hashNew) {
if (error) {
callback(error);
} else if (equal) {
DOM.getDataFromStorage(path, callback);
} else {
hash = hashNew;
RESTful.read(path, func);
}
});
};
/**
* unified way to save current file content
*