tro bo
This commit is contained in:
parent
7e5628344c
commit
027fd9f940
@ -42,7 +42,11 @@ class Notice {
|
||||
return ;
|
||||
|
||||
this.chatSocket.close();
|
||||
}
|
||||
|
||||
async reconnect() {
|
||||
this.disconnect();
|
||||
this.connect();
|
||||
}
|
||||
|
||||
async accept_invite(invitedBy) {
|
||||
|
@ -192,6 +192,7 @@ class Client
|
||||
{
|
||||
this.me = new MyProfile(this);
|
||||
await this.me.init();
|
||||
this.notice.reconnect();
|
||||
document.getElementById('navbarLoggedOut').classList.add('d-none');
|
||||
document.getElementById('navbarLoggedIn').classList.remove('d-none');
|
||||
document.getElementById('navbarDropdownButton').innerHTML = this.me.username;
|
||||
@ -200,6 +201,7 @@ class Client
|
||||
else
|
||||
{
|
||||
this.me = undefined;
|
||||
this.notice.reconnect();
|
||||
document.getElementById('navbarLoggedOut').classList.remove('d-none');
|
||||
document.getElementById('navbarLoggedIn').classList.add('d-none');
|
||||
document.getElementById('navbarDropdownButton').innerHTML = 'Me';
|
||||
|
@ -4,7 +4,7 @@ import { client, lang } from "../index.js"
|
||||
export default class extends AbstractView {
|
||||
constructor(params) {
|
||||
super(params, params.username);
|
||||
this.username = params.username;
|
||||
this.username = decodeURI(params.username);
|
||||
}
|
||||
|
||||
async postInit()
|
||||
|
@ -21,8 +21,6 @@ async function login(redirectTo = '/home')
|
||||
let response = await client.login(username, password);
|
||||
|
||||
if (response.status == 200) {
|
||||
await client.notice.disconnect();
|
||||
await client.notice.connect();
|
||||
navigateTo(redirectTo);
|
||||
} else {
|
||||
let error = await response.json();
|
||||
|
Loading…
Reference in New Issue
Block a user