mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
fix(edit) do not save hash when file update
This commit is contained in:
parent
e444e93230
commit
a01bf69776
1 changed files with 9 additions and 14 deletions
|
|
@ -157,19 +157,14 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch;
|
|||
|
||||
Util.ifExec(!isDiff, function(patch) {
|
||||
var query,
|
||||
isAllowed = DOM.Storage.isAllowed(),
|
||||
getSave = function(hash) {
|
||||
return function(data) {
|
||||
onSave(data, hash);
|
||||
};
|
||||
};
|
||||
isAllowed = DOM.Storage.isAllowed();
|
||||
|
||||
Value = lValue;
|
||||
|
||||
Util.ifExec(!isAllowed, function(loadHash) {
|
||||
DOM.RESTful.save(lPath, lValue, getSave(loadHash), query);
|
||||
Value = lValue;
|
||||
|
||||
Util.ifExec(!isAllowed, function() {
|
||||
DOM.RESTful.save(lPath, lValue, onSave, query);
|
||||
}, function(callback) {
|
||||
DOM.checkStorageHash(lPath, function(error, equal, loadHash) {
|
||||
DOM.checkStorageHash(lPath, function(error, equal) {
|
||||
var isString = Util.isString(patch),
|
||||
lessLength = patch.length < lValue.length;
|
||||
|
||||
|
|
@ -179,7 +174,7 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch;
|
|||
query = '?patch';
|
||||
}
|
||||
|
||||
callback(loadHash);
|
||||
callback();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -252,7 +247,7 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch;
|
|||
}
|
||||
}
|
||||
|
||||
function onSave(text, hash) {
|
||||
function onSave(text) {
|
||||
var ret,
|
||||
isError = Util.isContainStrAtBegin(text, 'error'),
|
||||
path = DOM.getCurrentPath(),
|
||||
|
|
@ -260,7 +255,7 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch;
|
|||
|
||||
if (!isError) {
|
||||
Edit.showMessage(text);
|
||||
DOM.saveDataToStorage(path, Value, hash);
|
||||
DOM.saveDataToStorage(path, Value);
|
||||
} else {
|
||||
ret = Dialog.confirm(text + msg);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue