diff --git a/frontend/static/js/api/chat/notice.js b/frontend/static/js/api/chat/notice.js index f882835..f512d91 100644 --- a/frontend/static/js/api/chat/notice.js +++ b/frontend/static/js/api/chat/notice.js @@ -42,7 +42,11 @@ class Notice { return ; this.chatSocket.close(); + } + async reconnect() { + this.disconnect(); + this.connect(); } async accept_invite(invitedBy) { diff --git a/frontend/static/js/api/client.js b/frontend/static/js/api/client.js index dc0a843..7e7a183 100644 --- a/frontend/static/js/api/client.js +++ b/frontend/static/js/api/client.js @@ -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'; diff --git a/frontend/static/js/views/ProfilePageView.js b/frontend/static/js/views/ProfilePageView.js index 9087332..9585423 100644 --- a/frontend/static/js/views/ProfilePageView.js +++ b/frontend/static/js/views/ProfilePageView.js @@ -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() diff --git a/frontend/static/js/views/accounts/LoginView.js b/frontend/static/js/views/accounts/LoginView.js index 19595fe..61b9b14 100644 --- a/frontend/static/js/views/accounts/LoginView.js +++ b/frontend/static/js/views/accounts/LoginView.js @@ -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();