fix: debouncing sync and other improvements

This commit is contained in:
2026-08-22 22:58:20 +02:00
parent e27e7a679e
commit c6e45cd067
17 changed files with 350 additions and 207 deletions
+4 -16
View File
@@ -1,29 +1,17 @@
<script setup lang="ts">
import { onMounted, onUnmounted } from 'vue'
import type { LocalList } from '@/database/db'
import { useEscapeKey } from '@/composables/useEscapeKey'
defineProps<{
list: LocalList
}>()
const emit = defineEmits<{
(e: 'close'): void
(e: 'confirm'): void
close: []
confirm: []
}>()
onMounted(() => {
document.addEventListener('keydown', handleKeydown)
})
onUnmounted(() => {
document.removeEventListener('keydown', handleKeydown)
})
function handleKeydown(event: KeyboardEvent) {
if (event.key === 'Escape') {
handleClose()
}
}
useEscapeKey(handleClose)
function handleClose() {
emit('close')