Don't redirect until realtime is synced when logging in
This commit is contained in:
@@ -132,9 +132,11 @@ define([
|
|||||||
if (result.proxy && !result.proxy.login_name) {
|
if (result.proxy && !result.proxy.login_name) {
|
||||||
result.proxy.login_name = result.userName;
|
result.proxy.login_name = result.userName;
|
||||||
}
|
}
|
||||||
|
Cryptpad.whenRealtimeSyncs(result.realtime, function () {
|
||||||
Cryptpad.login(result.userHash, result.userName, function () {
|
Cryptpad.login(result.userHash, result.userName, function () {
|
||||||
document.location.href = '/drive/';
|
document.location.href = '/drive/';
|
||||||
});
|
});
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (err) {
|
switch (err) {
|
||||||
|
|||||||
@@ -76,6 +76,8 @@ define([
|
|||||||
if (result.proxy && !result.proxy.login_name) {
|
if (result.proxy && !result.proxy.login_name) {
|
||||||
result.proxy.login_name = result.userName;
|
result.proxy.login_name = result.userName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Cryptpad.whenRealtimeSyncs(result.realtime, function() {
|
||||||
Cryptpad.login(result.userHash, result.userName, function () {
|
Cryptpad.login(result.userHash, result.userName, function () {
|
||||||
if (sessionStorage.redirectTo) {
|
if (sessionStorage.redirectTo) {
|
||||||
var h = sessionStorage.redirectTo;
|
var h = sessionStorage.redirectTo;
|
||||||
@@ -89,6 +91,7 @@ define([
|
|||||||
}
|
}
|
||||||
window.location.href = '/drive/';
|
window.location.href = '/drive/';
|
||||||
});
|
});
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (err) {
|
switch (err) {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ define([
|
|||||||
var obj = store.proxy;
|
var obj = store.proxy;
|
||||||
var $div = $('<div>', {'class': 'infoBlock'});
|
var $div = $('<div>', {'class': 'infoBlock'});
|
||||||
|
|
||||||
var accountName = obj.login_name;
|
var accountName = obj.login_name || localStorage[Cryptpad.userNameKey];
|
||||||
var $label = $('<span>', {'class': 'label'}).text(Messages.user_accountName + ':');
|
var $label = $('<span>', {'class': 'label'}).text(Messages.user_accountName + ':');
|
||||||
var $name = $('<span>').text(accountName || '');
|
var $name = $('<span>').text(accountName || '');
|
||||||
if (!accountName) {
|
if (!accountName) {
|
||||||
|
|||||||
Reference in New Issue
Block a user