Fix the infinite spinner bug with the file manager store

This commit is contained in:
yflory
2016-12-08 18:52:36 +01:00
parent 43ccd11adc
commit ee56f5608f
7 changed files with 61 additions and 15 deletions

View File

@@ -42,6 +42,11 @@ define([
secret.keys = secret.key;
}
var onConnectError = function (info) {
module.spinner.hide();
Cryptpad.alert(Messages.websocketError);
};
var andThen = function (CMeditor) {
var CodeMirror = module.CodeMirror = CMeditor;
CodeMirror.modeURL = "/bower_components/codemirror/mode/%N/%N.js";
@@ -687,10 +692,7 @@ define([
}
};
var onError = config.onError = function (info) {
module.spinner.hide();
Cryptpad.alert(Messages.websocketError);
};
var onError = config.onError = onConnectError();
var realtime = module.realtime = Realtime.start(config);
@@ -704,6 +706,11 @@ define([
// TODO handle error
andThen(CM);
});
Cryptpad.onError(function (info) {
if (info && info.type === "store") {
onConnectError();
}
});
};
var first = function () {