diff --git a/apps/app/src/api/ads.rs b/apps/app/src/api/ads.rs index 48ad99eab3..588f0319c8 100644 --- a/apps/app/src/api/ads.rs +++ b/apps/app/src/api/ads.rs @@ -699,15 +699,16 @@ pub async fn hide_ads_window( reset: Option, ) -> crate::api::Result<()> { let reset = reset.unwrap_or(false); + let state = app.state::>(); + let mut state = state.write().await; + + if reset { + state.shown = false; + state.consent_overlay_shown = false; + } if let Some(webview) = app.webviews().get("ads-window") { - let state = app.state::>(); - let mut state = state.write().await; - - if reset { - state.shown = false; - state.consent_overlay_shown = false; - } else { + if !reset { state.modal_shown = true; if state.consent_overlay_shown {