From 3917f5af37d3e06d2bde3659cfd3948e3eba87a7 Mon Sep 17 00:00:00 2001 From: Bamidev Date: Thu, 14 Mar 2024 21:56:23 +0100 Subject: [PATCH] Fixed navigation issue in edge2. --- src/core/browser_window/edge2.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/browser_window/edge2.rs b/src/core/browser_window/edge2.rs index 95d8817..6ca32ed 100644 --- a/src/core/browser_window/edge2.rs +++ b/src/core/browser_window/edge2.rs @@ -142,9 +142,12 @@ impl BrowserWindowExt for BrowserWindowImpl { move |_| Ok(()), ); + let mut created = AtomicBool::new(false);; webview.add_navigation_completed(move |wv, e| { - let handle = BrowserWindowImpl { inner: bw_inner }; - creation_callback(handle, callback_data); + if !created.swap(true, Ordering::Relaxed) { + let handle = BrowserWindowImpl { inner: bw_inner }; + creation_callback(handle, callback_data); + } Ok(()) });