mirror of
https://github.com/modrinth/code.git
synced 2026-08-26 17:44:50 +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:
@@ -8,8 +8,27 @@ export async function init_ads_window(overrideShown = false) {
|
||||
})
|
||||
}
|
||||
|
||||
export async function show_ads_window() {
|
||||
return await invoke('plugin:ads|show_ads_window', { dpr: window.devicePixelRatio })
|
||||
let adsWindowHoldUpdate = Promise.resolve()
|
||||
|
||||
async function update_ads_window_hold(acquire) {
|
||||
adsWindowHoldUpdate = adsWindowHoldUpdate
|
||||
.catch(() => {})
|
||||
.then(() =>
|
||||
invoke('plugin:ads|update_ads_window_hold', {
|
||||
acquire,
|
||||
dpr: window.devicePixelRatio,
|
||||
}),
|
||||
)
|
||||
|
||||
return await adsWindowHoldUpdate
|
||||
}
|
||||
|
||||
export async function take_ads_window_hold() {
|
||||
return await update_ads_window_hold(true)
|
||||
}
|
||||
|
||||
export async function release_ads_window_hold() {
|
||||
return await update_ads_window_hold(false)
|
||||
}
|
||||
|
||||
export async function hide_ads_window(reset) {
|
||||
|
||||
Reference in New Issue
Block a user