mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-09-11 16:08:21 +03:00
fix(core): race between drop old JS listeners and create new listeners on page load (#9144)
* fix(core): race between drop old JS listeners and create new listeners on page load * Create fix-js-unlisten-all-race.md
This commit is contained in:
parent
c3ea3a2b7d
commit
85de230f31
5
.changes/fix-js-unlisten-all-race.md
Normal file
5
.changes/fix-js-unlisten-all-race.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"tauri": patch:bug
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix old JS listeners being dropped on page load after it was possible to create new listeners.
|
@ -571,7 +571,7 @@ tauri::Builder::default()
|
|||||||
.on_page_load_handler
|
.on_page_load_handler
|
||||||
.replace(Box::new(move |url, event| {
|
.replace(Box::new(move |url, event| {
|
||||||
if let Some(w) = manager_.get_webview(&label_) {
|
if let Some(w) = manager_.get_webview(&label_) {
|
||||||
if let PageLoadEvent::Finished = event {
|
if let PageLoadEvent::Started = event {
|
||||||
w.unlisten_all_js();
|
w.unlisten_all_js();
|
||||||
}
|
}
|
||||||
if let Some(handler) = self.on_page_load_handler.as_ref() {
|
if let Some(handler) = self.on_page_load_handler.as_ref() {
|
||||||
|
Loading…
Reference in New Issue
Block a user