From 488ad0b9c9b794e266f8e3dab87480e99530129d Mon Sep 17 00:00:00 2001 From: RichardWGNR <171420035+RichardWGNR@users.noreply.github.com> Date: Tue, 25 Nov 2025 05:48:42 +0500 Subject: [PATCH] Fixing regression due to route preservation #4934 (#4980) --- packages/desktop/src/app.rs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/packages/desktop/src/app.rs b/packages/desktop/src/app.rs index 596c0d808..9ce95f031 100644 --- a/packages/desktop/src/app.rs +++ b/packages/desktop/src/app.rs @@ -7,8 +7,7 @@ use crate::{ shortcut::ShortcutRegistry, webview::{PendingWebview, WebviewInstance}, }; -use dioxus_core::{consume_context, ScopeId, VirtualDom}; -use dioxus_history::History; +use dioxus_core::VirtualDom; use std::{ cell::{Cell, RefCell}, collections::HashMap, @@ -480,9 +479,6 @@ impl App { #[cfg(debug_assertions)] fn persist_window_state(&self) { - use dioxus_core::ScopeId; - use dioxus_history::History; - if let Some(webview) = self.webviews.values().next() { let window = &webview.desktop_context.window; @@ -518,17 +514,12 @@ impl App { return; }; - let url = webview.dom.in_scope(ScopeId::ROOT, || { - consume_context::>().current_route() - }); - let state = PreservedWindowState { x, y, width: width.max(200), height: height.max(200), monitor: monitor_name.to_string(), - url: Some(url), }; // Yes... I know... we're loading a file that might not be ours... but it's a debug feature @@ -582,13 +573,6 @@ impl App { window.set_inner_size(tao::dpi::PhysicalSize::new(size.0, size.1)); } } - - // Set the url if it exists - webview.dom.in_scope(ScopeId::ROOT, || { - if let Some(url) = state.url { - consume_context::>().replace(url); - } - }) } } } @@ -627,7 +611,6 @@ struct PreservedWindowState { width: u32, height: u32, monitor: String, - url: Option, } /// Return the location of a tempfile with our window state in it such that we can restore it later