mirror of
https://github.com/modrinth/code.git
synced 2026-08-27 10:04:52 +00:00
fix: hide ad webview when showing fullscreen content (#7110)
* fix: hide ad webview when showing fullscreen content * fixes
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user