Add Comfy.User.SignOut command (#3608)

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2025-04-24 16:33:26 -04:00
committed by GitHub
parent 26f98d24fb
commit 0caf1686c3
16 changed files with 59 additions and 25 deletions

View File

@@ -82,16 +82,12 @@ import Divider from 'primevue/divider'
import ProgressSpinner from 'primevue/progressspinner'
import TabPanel from 'primevue/tabpanel'
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
import { useDialogService } from '@/services/dialogService'
import { useCommandStore } from '@/stores/commandStore'
import { useFirebaseAuthStore } from '@/stores/firebaseAuthStore'
import { useToastStore } from '@/stores/toastStore'
const toast = useToastStore()
const { t } = useI18n()
const authStore = useFirebaseAuthStore()
const dialogService = useDialogService()
const commandStore = useCommandStore()
const user = computed(() => authStore.currentUser)
const loading = computed(() => authStore.loading)
@@ -118,20 +114,10 @@ const providerIcon = computed(() => {
})
const handleSignOut = async () => {
await authStore.logout()
if (authStore.error) {
toast.addAlert(authStore.error)
} else {
toast.add({
severity: 'success',
summary: t('auth.signOut.success'),
detail: t('auth.signOut.successDetail'),
life: 5000
})
}
await commandStore.execute('Comfy.User.SignOut')
}
const handleSignIn = async () => {
await dialogService.showSignInDialog()
await commandStore.execute('Comfy.User.OpenSignInDialog')
}
</script>