fix: ads showing when sidebar is disabled on startup (#6806)

This commit is contained in:
Truman Gao
2026-07-21 22:27:27 +00:00
committed by GitHub
parent 6c86bb933b
commit 39fb75ebf7
+4 -3
View File
@@ -699,15 +699,16 @@ pub async fn hide_ads_window<R: Runtime>(
reset: Option<bool>,
) -> crate::api::Result<()> {
let reset = reset.unwrap_or(false);
if let Some(webview) = app.webviews().get("ads-window") {
let state = app.state::<RwLock<AdsState>>();
let mut state = state.write().await;
if reset {
state.shown = false;
state.consent_overlay_shown = false;
} else {
}
if let Some(webview) = app.webviews().get("ads-window") {
if !reset {
state.modal_shown = true;
if state.consent_overlay_shown {