Add confirmation

This commit is contained in:
Douglas Barone 2023-10-23 13:16:29 -04:00
parent abecf095f2
commit f8dda817e8
2 changed files with 15 additions and 15 deletions

View File

@ -53,6 +53,11 @@ const props = defineProps({
})
async function onLogout() {
if (
confirm(
'Deseja realmente sair? Você será desconectado e não poderá navegar na Internet até fazer login novamente.'
)
) {
const success = await trpc.logout.mutate({
username: props.loginResult.username,
domain: props.loginResult.domain
@ -64,6 +69,7 @@ async function onLogout() {
} else {
alert('Não foi possível fazer logout. Tente novamente.')
}
}
}
function onClose() {

View File

@ -23,12 +23,6 @@ import { LoginResult } from '@/server/interfaces/Auth'
const loginResult = ref<LoginResult | null>(null)
function onLogin(event: LoginResult) {
console.log(event)
loginResult.value = event
}
function onLogout() {
loginResult.value = null
}
</script>