From 94a4c4cdf8ba12c41cc5ae5bee272ff22886027b Mon Sep 17 00:00:00 2001 From: starnakin Date: Tue, 13 Feb 2024 14:07:53 +0100 Subject: [PATCH] fix: typo isAuthenticate -> isAuthenticated --- frontend/static/js/api/client.js | 2 +- frontend/static/js/api/matchmaking.js | 2 +- frontend/static/js/api/tournament/tournament.js | 2 +- frontend/static/js/index.js | 2 +- frontend/static/js/views/ProfilePageView.js | 4 ++-- frontend/static/js/views/Search.js | 2 +- frontend/static/js/views/SettingsView.js | 2 +- .../static/js/views/abstracts/AbstractAuthenticatedView.js | 2 +- .../static/js/views/abstracts/AbstractNonAuthenticatedView.js | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/static/js/api/client.js b/frontend/static/js/api/client.js index f414a15..df0a7b1 100644 --- a/frontend/static/js/api/client.js +++ b/frontend/static/js/api/client.js @@ -80,7 +80,7 @@ class Client * The only right way to determine is the user is logged * @returns {Promise} */ - async isAuthenticate() + async isAuthenticated() { if (this._logged == undefined) this._logged = await this._test_logged(); diff --git a/frontend/static/js/api/matchmaking.js b/frontend/static/js/api/matchmaking.js index 5a6a651..03063ca 100644 --- a/frontend/static/js/api/matchmaking.js +++ b/frontend/static/js/api/matchmaking.js @@ -23,7 +23,7 @@ class MatchMaking */ async start(receive_func, disconnect_func, mode) { - if (!await this.client.isAuthenticate()) + if (!await this.client.isAuthenticated()) return null; let url = `${window.location.protocol[4] === 's' ? 'wss' : 'ws'}://${window.location.host}/ws/matchmaking/${mode}`; diff --git a/frontend/static/js/api/tournament/tournament.js b/frontend/static/js/api/tournament/tournament.js index e8782ea..bbba2d8 100644 --- a/frontend/static/js/api/tournament/tournament.js +++ b/frontend/static/js/api/tournament/tournament.js @@ -120,7 +120,7 @@ class Tourmanent */ async join(receive_func, disconnect_func) { - if (!await this.client.isAuthenticate()) + if (!await this.client.isAuthenticated()) return null; let url = `${window.location.protocol[4] === 's' ? 'wss' : 'ws'}://${window.location.host}/ws/tournaments/${this.id}`; diff --git a/frontend/static/js/index.js b/frontend/static/js/index.js index 2094fea..fc4d560 100644 --- a/frontend/static/js/index.js +++ b/frontend/static/js/index.js @@ -152,7 +152,7 @@ document.addEventListener("DOMContentLoaded", async () => { document.querySelector(`#languageSelector > [value=${lang.chosenLang}]`) ?.classList.add('active'); - await client.isAuthenticate(); + await client.isAuthenticated(); router(location.pathname); document.querySelector('a[href=\'' + location.pathname + '\']')?.classList.add('active'); }); diff --git a/frontend/static/js/views/ProfilePageView.js b/frontend/static/js/views/ProfilePageView.js index 9a3f2bf..7f69a64 100644 --- a/frontend/static/js/views/ProfilePageView.js +++ b/frontend/static/js/views/ProfilePageView.js @@ -44,7 +44,7 @@ export default class extends AbstractView { async blockButton() { // Block option - if (await client.isAuthenticate() === false) + if (await client.isAuthenticated() === false) return; if (client.me.id != this.user_id) { @@ -72,7 +72,7 @@ export default class extends AbstractView { } async friendButton() { - if (await client.isAuthenticate() === false) + if (await client.isAuthenticated() === false) return; if (client.me.id != this.user_id) { diff --git a/frontend/static/js/views/Search.js b/frontend/static/js/views/Search.js index 61d1c93..487c906 100644 --- a/frontend/static/js/views/Search.js +++ b/frontend/static/js/views/Search.js @@ -21,7 +21,7 @@ export default class extends AbstractView { async postInit() { - let logged = await client.isAuthenticate(); + let logged = await client.isAuthenticated(); let profiles = await client.profiles.all(); //console.log(client.notice.data); diff --git a/frontend/static/js/views/SettingsView.js b/frontend/static/js/views/SettingsView.js index c2b4410..5f2ceff 100644 --- a/frontend/static/js/views/SettingsView.js +++ b/frontend/static/js/views/SettingsView.js @@ -36,7 +36,7 @@ export default class extends AbstractAuthenticatedView let response_data = await client.account.delete(current_password); - console.log(await client.isAuthenticate()) + console.log(await client.isAuthenticated()) if (response_data === null || response_data === "user deleted") { navigateTo("/login"); diff --git a/frontend/static/js/views/abstracts/AbstractAuthenticatedView.js b/frontend/static/js/views/abstracts/AbstractAuthenticatedView.js index a051f4f..cf5341f 100644 --- a/frontend/static/js/views/abstracts/AbstractAuthenticatedView.js +++ b/frontend/static/js/views/abstracts/AbstractAuthenticatedView.js @@ -8,7 +8,7 @@ export default class extends AbstractRedirectView{ async redirect() { - if (await client.isAuthenticate() === false) + if (await client.isAuthenticated() === false) { navigateTo(this.redirect_url); return 1; diff --git a/frontend/static/js/views/abstracts/AbstractNonAuthenticatedView.js b/frontend/static/js/views/abstracts/AbstractNonAuthenticatedView.js index b0d43da..d70df04 100644 --- a/frontend/static/js/views/abstracts/AbstractNonAuthenticatedView.js +++ b/frontend/static/js/views/abstracts/AbstractNonAuthenticatedView.js @@ -8,7 +8,7 @@ export default class extends AbstractRedirectView{ async redirect() { - if (await client.isAuthenticate() === false) + if (await client.isAuthenticated() === false) return 0; navigateTo(this.redirect_url); return 1;