mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-06 08:00:05 +00:00
24 lines
542 B
Vue
24 lines
542 B
Vue
<template>
|
|
<SidebarIcon icon="pi pi-sign-out" :tooltip="tooltip" @click="logout" />
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
import { useUserStore } from '@/stores/userStore'
|
|
|
|
import SidebarIcon from './SidebarIcon.vue'
|
|
|
|
const { t } = useI18n()
|
|
const userStore = useUserStore()
|
|
|
|
const tooltip = computed(
|
|
() => `${t('sideToolbar.logout')} (${userStore.currentUser?.username})`
|
|
)
|
|
const logout = async () => {
|
|
await userStore.logout()
|
|
window.location.reload()
|
|
}
|
|
</script>
|