Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[feat] Improve VideoHelpDialog cleanup using onWatcherCleanup
Use Vue 3.5+ onWatcherCleanup() for automatic event listener cleanup instead of relying on VueUse's internal cleanup. This provides more explicit control and follows Vue 3.5+ best practices.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
  • Loading branch information
luke-mino-altherr and claude committed Dec 5, 2025
commit a8a7015949e56672945237a525faa6e46dd72f0e
9 changes: 6 additions & 3 deletions src/platform/assets/components/VideoHelpDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<script setup lang="ts">
import { useEventListener } from '@vueuse/core'
import Dialog from 'primevue/dialog'
import { watch } from 'vue'
import { onWatcherCleanup, watch } from 'vue'

import IconButton from '@/components/button/IconButton.vue'

Expand All @@ -50,7 +50,7 @@ const { videoUrl, ariaLabel = 'Help video' } = defineProps<{
}>()

const handleEscapeKey = (event: KeyboardEvent) => {
if (event.key === 'Escape' && isVisible.value) {
if (event.key === 'Escape') {
event.stopImmediatePropagation()
event.stopPropagation()
event.preventDefault()
Expand All @@ -64,7 +64,10 @@ watch(
isVisible,
(visible) => {
if (visible) {
useEventListener(document, 'keydown', handleEscapeKey, { capture: true })
const stop = useEventListener(document, 'keydown', handleEscapeKey, {
capture: true
})
onWatcherCleanup(stop)
}
},
{ immediate: true }
Expand Down