Skip to content

Commit

Permalink
Fixed navigation issue in edge2.
Browse files Browse the repository at this point in the history
  • Loading branch information
bamidev committed Mar 14, 2024
1 parent 9ec468e commit 2bc682b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/core/browser_window/edge2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{borrow::Cow, cell::Cell, ffi::c_void, ptr};
use std::{borrow::Cow, cell::Cell, ffi::c_void, ptr, sync::atomic::{AtomicBool, Ordering}};

use webview2::Environment;
use winapi::{shared::windef, um::winuser};
Expand Down Expand Up @@ -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(())
});

Expand Down

0 comments on commit 2bc682b

Please sign in to comment.