perf(Torrent Detail): Add escape exception if modals (#974)

This commit is contained in:
Rémi Marseault 2023-07-18 10:28:03 +02:00 committed by GitHub
parent 287329ed32
commit 28aeb3e8f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -81,7 +81,7 @@ export default defineComponent({
}
},
computed: {
...mapGetters(['getTorrent']),
...mapGetters(['getTorrent', 'getModals']),
torrent() {
//@ts-expect-error: TS2339: Property 'getTorrent' does not exist on type 'CreateComponentPublicInstance...'.
return this.getTorrent(this.hash)
@ -103,7 +103,7 @@ export default defineComponent({
this.$router.back()
},
handleKeyboardShortcut(e: KeyboardEvent) {
if (e.key === 'Escape') {
if (e.key === 'Escape' && this.getModals().length === 0) {
this.close()
}
}