|
@@ -671,10 +671,11 @@ function fetchLoginCredentials (wait=0) {
|
|
xhr.onload = () => {
|
|
xhr.onload = () => {
|
|
if (xhr.status >= 200 && xhr.status < 400) {
|
|
if (xhr.status >= 200 && xhr.status < 400) {
|
|
const data = JSON.parse(xhr.responseText);
|
|
const data = JSON.parse(xhr.responseText);
|
|
- setUserJID(data.jid);
|
|
|
|
- resolve({
|
|
|
|
- jid: data.jid,
|
|
|
|
- password: data.password
|
|
|
|
|
|
+ setUserJID(data.jid).then(() => {
|
|
|
|
+ resolve({
|
|
|
|
+ jid: data.jid,
|
|
|
|
+ password: data.password
|
|
|
|
+ });
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
reject(new Error(`${xhr.status}: ${xhr.responseText}`));
|
|
reject(new Error(`${xhr.status}: ${xhr.responseText}`));
|