This commit is contained in:
AdrienLSH
2024-02-02 13:31:26 +01:00
parent 0c98bd5dde
commit d63fa26088
4 changed files with 7 additions and 3 deletions

View File

@ -42,7 +42,11 @@ class Notice {
return ;
this.chatSocket.close();
}
async reconnect() {
this.disconnect();
this.connect();
}
async accept_invite(invitedBy) {

View File

@ -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';