diff --git a/customize.dist/main.js b/customize.dist/main.js index 83295af5b..8452a2480 100644 --- a/customize.dist/main.js +++ b/customize.dist/main.js @@ -132,8 +132,10 @@ define([ if (result.proxy && !result.proxy.login_name) { result.proxy.login_name = result.userName; } - Cryptpad.login(result.userHash, result.userName, function () { - document.location.href = '/drive/'; + Cryptpad.whenRealtimeSyncs(result.realtime, function () { + Cryptpad.login(result.userHash, result.userName, function () { + document.location.href = '/drive/'; + }); }); return; } diff --git a/www/login/main.js b/www/login/main.js index e18732671..b8ec37c0b 100644 --- a/www/login/main.js +++ b/www/login/main.js @@ -76,18 +76,21 @@ define([ if (result.proxy && !result.proxy.login_name) { result.proxy.login_name = result.userName; } - Cryptpad.login(result.userHash, result.userName, function () { - if (sessionStorage.redirectTo) { - var h = sessionStorage.redirectTo; - var parser = document.createElement('a'); - parser.href = h; - if (parser.origin === window.location.origin) { - delete sessionStorage.redirectTo; - window.location.href = h; - return; + + Cryptpad.whenRealtimeSyncs(result.realtime, function() { + Cryptpad.login(result.userHash, result.userName, function () { + if (sessionStorage.redirectTo) { + var h = sessionStorage.redirectTo; + var parser = document.createElement('a'); + parser.href = h; + if (parser.origin === window.location.origin) { + delete sessionStorage.redirectTo; + window.location.href = h; + return; + } } - } - window.location.href = '/drive/'; + window.location.href = '/drive/'; + }); }); return; } diff --git a/www/settings/main.js b/www/settings/main.js index 8cdb95b2f..cf3f221c0 100644 --- a/www/settings/main.js +++ b/www/settings/main.js @@ -42,7 +42,7 @@ define([ var obj = store.proxy; var $div = $('