fix: hide ad webview when showing fullscreen content (#7110)

* fix: hide ad webview when showing fullscreen content

* fixes
This commit is contained in:
aecsocket
2026-08-12 16:02:02 +00:00
committed by GitHub
parent c34bd26f87
commit 6ec979a076
9 changed files with 186 additions and 171 deletions
@@ -93,7 +93,7 @@ import {
import { ButtonLink, Card, IconButton, useFormatDateTime } from '@modrinth/ui'
import { computed, onMounted, onUnmounted, ref } from 'vue'
import { hide_ads_window, show_ads_window } from '@/helpers/ads.js'
import { release_ads_window_hold, take_ads_window_hold } from '@/helpers/ads.js'
import { trackEvent } from '@/helpers/analytics'
const MC_SERVER_BANNER_NAME = '__mc_server_banner__'
@@ -118,10 +118,14 @@ const filteredGallery = computed(
const expandedGalleryItem = ref(null)
const expandedGalleryIndex = ref(0)
const zoomedIn = ref(false)
let adsWindowHold = false
const hideImage = () => {
expandedGalleryItem.value = null
show_ads_window()
if (adsWindowHold) {
adsWindowHold = false
release_ads_window_hold()
}
}
const nextImage = () => {
@@ -149,7 +153,10 @@ const previousImage = () => {
}
const expandImage = (item, index) => {
hide_ads_window()
if (!adsWindowHold) {
adsWindowHold = true
take_ads_window_hold()
}
expandedGalleryItem.value = item
expandedGalleryIndex.value = index
zoomedIn.value = false
@@ -181,6 +188,10 @@ onMounted(() => {
onUnmounted(() => {
document.removeEventListener('keydown', keyListener)
if (adsWindowHold) {
adsWindowHold = false
release_ads_window_hold()
}
})
</script>