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