mirror of
https://github.com/OpenBankProject/API-Explorer-II.git
synced 2026-02-06 10:47:04 +00:00
change login checking for chat widget
This commit is contained in:
parent
c6b0dd5a42
commit
ceb6f5c485
1
components.d.ts
vendored
1
components.d.ts
vendored
@ -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']
|
||||
|
||||
@ -47,14 +47,14 @@ export default {
|
||||
methods: {
|
||||
async toggleChat() {
|
||||
this.chatOpen = !this.chatOpen
|
||||
if (!this.chat.userIsAuthenticated) {
|
||||
await this.chat.handleAuthentication()
|
||||
}
|
||||
},
|
||||
async checkLoginStatus(): Promise<boolean> {
|
||||
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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user