Hopefully fix infinite spinner whenever there is a disconnect (pad)
This commit is contained in:
@@ -12,9 +12,10 @@ define([
|
||||
|
||||
'/customize/application_config.js',
|
||||
'/common/cryptpad-common.js',
|
||||
'/common/common-realtime.js'
|
||||
'/common/common-realtime.js',
|
||||
'/common/common-util.js'
|
||||
], function ($, nThen, Messages, CpNfInner, SFrameChannel, Title, UI, History, File, MetadataMgr,
|
||||
AppConfig, Cryptpad, CommonRealtime) {
|
||||
AppConfig, Cryptpad, CommonRealtime, Util) {
|
||||
|
||||
// Chainpad Netflux Inner
|
||||
var funcs = {};
|
||||
@@ -22,12 +23,15 @@ define([
|
||||
|
||||
funcs.Messages = Messages;
|
||||
|
||||
var evRealtimeSynced = Util.mkEvent(true);
|
||||
|
||||
funcs.startRealtime = function (options) {
|
||||
if (ctx.cpNfInner) { return ctx.cpNfInner; }
|
||||
options.sframeChan = ctx.sframeChan;
|
||||
options.metadataMgr = ctx.metadataMgr;
|
||||
ctx.cpNfInner = CpNfInner.start(options);
|
||||
ctx.cpNfInner.metadataMgr.onChangeLazy(options.onLocal);
|
||||
ctx.cpNfInner.whenRealtimeSyncs(function () { evRealtimeSynced.fire(); });
|
||||
return ctx.cpNfInner;
|
||||
};
|
||||
|
||||
@@ -197,6 +201,10 @@ define([
|
||||
});
|
||||
}; */
|
||||
|
||||
funcs.gotoURL = function (url) { ctx.sframeChan.event('EV_GOTO_URL', url); };
|
||||
|
||||
funcs.whenRealtimeSyncs = evRealtimeSynced.reg;
|
||||
|
||||
Object.freeze(funcs);
|
||||
return { create: function (cb) {
|
||||
nThen(function (waitFor) {
|
||||
|
||||
Reference in New Issue
Block a user