passphrase prompt

This commit is contained in:
2023-05-23 00:44:51 +02:00
parent 6a53d9fd58
commit 6f19ee94d1
6 changed files with 110 additions and 27 deletions

View File

@@ -4,13 +4,20 @@ import { onClickOutside } from '@vueuse/core'
const props = withDefaults(
defineProps<{
open?: boolean
persistent?: boolean
}>(),
{
open: false
open: false,
persistent: false
}
)
const show = ref<boolean>(Boolean(props.open))
const show = ref<boolean>(false)
watch(
() => props.open,
() => (show.value = props.open),
{ immediate: true }
)
const modal = ref<HTMLElement | null>(null)
const modalBox = ref(null)
@@ -25,7 +32,7 @@ const close = (): Promise<boolean> => {
const slotProps = { open, close }
onClickOutside(modalBox, () => close())
if (!props.persistent) onClickOutside(modalBox, () => close())
const onEnter = (el: Element, done: () => void): void => {
setTimeout(() => {