Merge beta into release #21

Merged
didirus merged 276 commits from beta into release 2025-11-01 13:04:25 +00:00
2 changed files with 13 additions and 3 deletions
Showing only changes of commit 8b39ba491a - Show all commits
@@ -92,7 +92,7 @@ import {
XIcon, XIcon,
} from '@modrinth/assets' } from '@modrinth/assets'
import { Button, Card } from '@modrinth/ui' import { Button, Card } from '@modrinth/ui'
import { ref } from 'vue' import { onMounted, onUnmounted, ref } from 'vue'
import { hide_ads_window, show_ads_window } from '@/helpers/ads.js' import { hide_ads_window, show_ads_window } from '@/helpers/ads.js'
import { trackEvent } from '@/helpers/analytics' import { trackEvent } from '@/helpers/analytics'
@@ -151,17 +151,26 @@ const expandImage = (item, index) => {
function keyListener(e) { function keyListener(e) {
if (expandedGalleryItem.value) { if (expandedGalleryItem.value) {
e.preventDefault()
if (e.key === 'Escape') { if (e.key === 'Escape') {
e.preventDefault()
hideImage() hideImage()
} else if (e.key === 'ArrowLeft') { } else if (e.key === 'ArrowLeft') {
e.preventDefault()
previousImage() previousImage()
} else if (e.key === 'ArrowRight') { } else if (e.key === 'ArrowRight') {
e.preventDefault()
nextImage() nextImage()
} }
} }
} }
document.addEventListener('keypress', keyListener)
onMounted(() => {
document.addEventListener('keydown', keyListener)
})
onUnmounted(() => {
document.removeEventListener('keydown', keyListener)
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@@ -631,6 +631,7 @@ onMounted(() => {
}) })
onUnmounted(() => { onUnmounted(() => {
window.removeEventListener('keydown', handleKeybinds)
notifications.setNotificationLocation('right') notifications.setNotificationLocation('right')
}) })