Skip to content

Commit

Permalink
* Put event listener back to mounted
Browse files Browse the repository at this point in the history
  • Loading branch information
PikachuEXE committed Nov 29, 2024
1 parent cee5e9d commit ad83ebf
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/renderer/views/SubscribedChannels/SubscribedChannels.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
</template>

<script setup>
import { computed, onBeforeUnmount, ref, watch } from 'vue'
import { computed, onMounted, onBeforeUnmount, ref, watch } from 'vue'
import { isNavigationFailure, NavigationFailureType } from 'vue-router'
import { useRoute, useRouter } from 'vue-router/composables'
import FtCard from '../../components/ft-card/ft-card.vue'
Expand Down Expand Up @@ -265,16 +265,21 @@ watch(activeSubscriptionList, () => {
filterChannels()
})
;(() => {
document.addEventListener('keydown', keyboardShortcutHandler)
getSubscription()
// region created
const oldQuery = route.query.searchQueryText ?? ''
if (oldQuery !== null && oldQuery !== '') {
// `handleQueryChange` must be called after `filterHistoryDebounce` assigned
handleQueryChange(oldQuery, true)
}
})()
getSubscription()
const oldQuery = route.query.searchQueryText ?? ''
if (oldQuery !== null && oldQuery !== '') {
// `handleQueryChange` must be called after `filterHistoryDebounce` assigned
handleQueryChange(oldQuery, true)
}
// endregion created
onMounted(() => {
document.addEventListener('keydown', keyboardShortcutHandler)
})
onBeforeUnmount(() => {
document.removeEventListener('keydown', keyboardShortcutHandler)
Expand Down

0 comments on commit ad83ebf

Please sign in to comment.