From 39fb75ebf76530122e4b597c9be6e6711e9b63f3 Mon Sep 17 00:00:00 2001 From: Truman Gao <106889354+tdgao@users.noreply.github.com> Date: Tue, 21 Jul 2026 16:27:27 -0600 Subject: [PATCH] fix: ads showing when sidebar is disabled on startup (#6806) --- apps/app/src/api/ads.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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 {