diff --git a/components.d.ts b/components.d.ts index 734440b..cde94e5 100644 --- a/components.d.ts +++ b/components.d.ts @@ -48,6 +48,7 @@ declare module 'vue' { RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] SearchNav: typeof import('./src/components/SearchNav.vue')['default'] + StandaloneChat: typeof import('./src/components/StandaloneChat.vue')['default'] } export interface ComponentCustomProperties { vLoading: typeof import('element-plus/es')['ElLoadingDirective'] diff --git a/src/components/ChatWidget.vue b/src/components/ChatWidget.vue index 6b18dcf..d186af5 100644 --- a/src/components/ChatWidget.vue +++ b/src/components/ChatWidget.vue @@ -47,14 +47,14 @@ export default { methods: { async toggleChat() { this.chatOpen = !this.chatOpen - if (!this.chat.userIsAuthenticated) { - await this.chat.handleAuthentication() - } }, async checkLoginStatus(): Promise { const currentUser = await getCurrentUser() const currentResponseKeys = Object.keys(currentUser) if (currentResponseKeys.includes('username')) { + if (!this.chat.userIsAuthenticated) { + await this.chat.handleAuthentication() + } return true } else { return false