Skip to content

Commit a90303b

Browse files
committed
fix: unsubscribe query
1 parent 532f762 commit a90303b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/VueCommandQuery.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ import {
8080
watch,
8181
inject,
8282
defineExpose,
83-
onBeforeMount,
83+
onBeforeUnmount,
8484
reactive,
8585
nextTick,
8686
computed
@@ -244,6 +244,7 @@ const reverseISearch = event => {
244244
}
245245
// Cancels the current query or multiline query and creates a new query
246246
const sigint = () => {
247+
console.debug('sigint')
247248
if (isEmpty(multilineQueries)) {
248249
// "setQuery" would overwrite the parent query while we only need to
249250
// overwrite the locale one
@@ -365,6 +366,10 @@ onMounted(() => {
365366
})
366367
}
367368
})
369+
onBeforeUnmount(() => {
370+
// If query is removed from history, unsubscribe from "SIGINT"
371+
signals.off('SIGINT', sigint)
372+
})
368373
369374
defineExpose({
370375
focus

0 commit comments

Comments
 (0)