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

@@ -77,6 +77,11 @@ define([
return hj;
};
var onConnectError = function (info) {
module.spinner.hide();
Cryptpad.alert(Messages.websocketError);
};
var andThen = function (Ckeditor) {
var secret = Cryptpad.getSecrets();
var readOnly = secret.keys && !secret.keys.editKeyStr;
@@ -691,10 +696,7 @@ define([
}
};
var onError = realtimeOptions.onError = function (info) {
module.spinner.hide();
Cryptpad.alert(Messages.websocketError);
};
var onError = realtimeOptions.onError = onConnectError;
var onLocal = realtimeOptions.onLocal = function () {
if (initializing) { return; }
@@ -741,6 +743,11 @@ define([
// TODO handle error
andThen(Ckeditor);
});
Cryptpad.onError(function (info) {
if (info && info.type === "store") {
onConnectError();
}
});
};
var first = function () {