Hide infinite spinner and disconnect modals when pad is deleted

This commit is contained in:
yflory
2018-02-15 11:34:44 +01:00
parent ef0c08130d
commit 70e014cdfc
6 changed files with 45 additions and 45 deletions

View File

@@ -598,6 +598,7 @@ define([
};
config.onAbort = function () {
if (APP.unrecoverable) { return; }
// inform of network disconnect
setEditable(false);
toolbar.failed();
@@ -605,6 +606,7 @@ define([
};
config.onConnectionChange = function (info) {
if (APP.unrecoverable) { return; }
setEditable(info.state);
if (info.state) {
initializing = true;
@@ -615,27 +617,17 @@ define([
};
config.onError = function (err) {
setEditable(false);
toolbar.deleted();
var msg = err.type;
if (err.type === 'EEXPIRED') {
msg = Messages.expiredError;
if (err.loaded) {
msg += Messages.expiredErrorCopy;
}
} else if (err.type === 'EDELETED') {
msg = Messages.deletedError;
if (err.loaded) {
msg += Messages.expiredErrorCopy;
}
}
UI.errorLoadingScreen(msg, true, true);
common.onServerError(err, toolbar, function () {
APP.unrecoverable = true;
setEditable(false);
});
};
cpNfInner = common.startRealtime(config);
metadataMgr = cpNfInner.metadataMgr;
cpNfInner.onInfiniteSpinner(function () {
if (APP.unrecoverable) { return; }
setEditable(false);
UI.confirm(Messages.realtime_unrecoverableError, function (yes) {
if (!yes) { return; }