Hopefully fix infinite spinner whenever there is a disconnect (pad)

This commit is contained in:
Caleb James DeLisle
2017-09-11 15:46:21 +02:00
parent 684a12ce2e
commit 7334173b4a
10 changed files with 128 additions and 43 deletions

View File

@@ -33,7 +33,6 @@ define([
'/bower_components/nthen/index.js',
'/common/sframe-common.js',
'/api/config',
'/common/common-realtime.js',
'/bower_components/file-saver/FileSaver.min.js',
'/bower_components/diff-dom/diffDOM.js',
@@ -56,8 +55,7 @@ define([
Links,
nThen,
SFCommon,
ApiConfig,
CommonRealtime)
ApiConfig)
{
var saveAs = window.saveAs;
var Messages = Cryptpad.Messages;
@@ -339,8 +337,6 @@ define([
}
};
CommonRealtime.onInfiniteSpinner(function () { setEditable(false); });
// don't let the user edit until the pad is ready
setEditable(false);
@@ -717,6 +713,15 @@ define([
cpNfInner = common.startRealtime(realtimeOptions);
metadataMgr = cpNfInner.metadataMgr;
cpNfInner.onInfiniteSpinner(function () {
setEditable(false);
Cryptpad.confirm(Messages.realtime_unrecoverableError, function (yes) {
if (!yes) { return; }
common.gotoURL();
//window.parent.location.reload();
});
});
Cryptpad.onLogout(function () { setEditable(false); });
/* hitting enter makes a new line, but places the cursor inside