From deda40375ae4039352135bc5485cf9d349c2ba99 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 17 Feb 2017 10:31:07 +0100 Subject: [PATCH] Use the new onSettle from chainpad to determine if the realtime is synced --- www/common/cryptpad-common.js | 9 +-------- www/drive/main.js | 1 - 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 1097e4e55..6094dfa33 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -46,14 +46,7 @@ define([ var whenRealtimeSyncs = common.whenRealtimeSyncs = function (realtime, cb) { realtime.sync(); - var interval = 300; - var check = function () { - if (realtime.getAuthDoc() !== realtime.getUserDoc()) { - return window.setTimeout(check, interval); - } - cb(); - }; - window.setTimeout(check, interval); + realtime.onSettle(cb); }; var getWebsocketURL = common.getWebsocketURL = function () { diff --git a/www/drive/main.js b/www/drive/main.js index 0f544ee22..9bdf42e4a 100644 --- a/www/drive/main.js +++ b/www/drive/main.js @@ -1873,7 +1873,6 @@ define([ }; var createReadme = function (proxy, cb) { if (proxy.initializing) { - console.log('test'); var hash = Cryptpad.createRandomHash(); Get.put(hash, Messages.driveReadme, function (e) { if (e) { console.error(e); }