From ec64ac485d2cc29e35fa47e6c94c3541509154c8 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 23 Aug 2017 11:06:55 +0200 Subject: [PATCH] Fix 'not a function' error --- www/common/common-realtime.js | 4 ++-- www/common/cryptpad-common.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/www/common/common-realtime.js b/www/common/common-realtime.js index 5b0483008..abf0e1cca 100644 --- a/www/common/common-realtime.js +++ b/www/common/common-realtime.js @@ -13,7 +13,7 @@ define([ /* TODO make this not blow up when disconnected or lagging... */ - common.whenRealtimeSyncs = function (realtime, cb) { + common.whenRealtimeSyncs = function (Cryptpad, realtime, cb) { realtime.sync(); window.setTimeout(function () { @@ -28,7 +28,7 @@ define([ if (common.infiniteSpinnerDetected) { return; } // inform the user their session is in a bad state - common.confirm(Messages.realtime_unrecoverableError, function (yes) { + Cryptpad.confirm(Messages.realtime_unrecoverableError, function (yes) { if (!yes) { return; } window.location.reload(); }); diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 7544d562f..13dd0a903 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -132,7 +132,9 @@ define([ common.initMessagingUI = Messaging.UI.init; // Realtime - var whenRealtimeSyncs = common.whenRealtimeSyncs = Realtime.whenRealtimeSyncs; + var whenRealtimeSyncs = common.whenRealtimeSyncs = function (realtime, cb) { + Realtime.whenRealtimeSyncs(common, realtime, cb); + }; // Userlist common.createUserList = UserList.create;