mirror of
https://github.com/modrinth/code.git
synced 2026-08-25 17:14:50 +00:00
fix app build on windows & mac (#7118)
This commit is contained in:
+10
-1
@@ -187,10 +187,19 @@ async fn sync_ads_occlusion<R: Runtime>(app: &tauri::AppHandle<R>) {
|
||||
|
||||
state.occluded = occluded;
|
||||
let visible = should_show_ads_webview(&state);
|
||||
let consent_overlay_shown = state.consent_overlay_shown;
|
||||
drop(state);
|
||||
|
||||
if let Some(webview) = app.webviews().get("ads-window") {
|
||||
set_webview_visible_for_window(app, webview, visible);
|
||||
let is_minimized = app
|
||||
.get_window("main")
|
||||
.and_then(|window| window.is_minimized().ok())
|
||||
.unwrap_or(false);
|
||||
|
||||
set_webview_visible(
|
||||
webview,
|
||||
visible && !is_minimized && (!occluded || consent_overlay_shown),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user