11<template >
2- <Dialog v-model:visible =" visible" modal pt:root:class =" border-none" pt:mask:style =" backdrop-filter: blur(2px)" v-if =" !isWebAuthnUnavailable" >
2+ <Dialog
3+ v-model:visible =" is_webauthn_open"
4+ modal
5+ pt:root:class =" border-none"
6+ pt:mask:style =" backdrop-filter: blur(2px)"
7+ v-if =" !isWebAuthnUnavailable"
8+ >
39 <template #container =" { closeCallback } " >
410 <form v-focustrap class =" flex flex-col gap-4 relative max-w-full text-sm rounded-md pt-9" >
511 <div class =" inline-flex flex-col gap-2 px-9" >
@@ -30,15 +36,19 @@ import InputText from "../forms/basic/InputText.vue";
3036import { trans } from " laravel-vue-i18n" ;
3137import WebAuthnService from " @/services/webauthn-service" ;
3238import { useAuthStore } from " @/stores/Auth" ;
39+ import { useTogglablesStateStore } from " @/stores/ModalsState" ;
3340import AlbumService from " @/services/album-service" ;
41+ import { storeToRefs } from " pinia" ;
3442
3543const toast = useToast ();
36- const visible = defineModel (" visible" , { default: false }) as Ref <boolean >;
3744const emits = defineEmits <{
3845 " logged-in" : [];
3946}>();
4047
48+ const togglableStore = useTogglablesStateStore ();
49+
4150const isWebAuthnUnavailable = computed <boolean >(() => WebAuthnService .isWebAuthnUnavailable ());
51+ const { is_webauthn_open } = storeToRefs (togglableStore );
4252
4353const authStore = useAuthStore ();
4454const username = ref (" " );
@@ -52,7 +62,7 @@ function login() {
5262 summary: trans (" lychee.U2F_AUTHENTIFICATION_SUCCESS" ),
5363 life: 3000 ,
5464 });
55- visible .value = false ;
65+ is_webauthn_open .value = false ;
5666 authStore .setUser (null );
5767 AlbumService .clearCache ();
5868 emits (" logged-in" );
0 commit comments