mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
fix(tauri) race condition on onTauriInit and no-server mode (#257)
This commit is contained in:
committed by
GitHub
parent
e17c5f84b1
commit
ddd0e2c3eb
@@ -85,7 +85,15 @@ pub(crate) fn run(application: &mut crate::App) {
|
||||
webview.eval("
|
||||
if (window.onTauriInit !== void 0) {
|
||||
window.onTauriInit()
|
||||
window.onTauriInit = void 0
|
||||
}
|
||||
Object.defineProperty(window, 'onTauriInit', {
|
||||
set: function(val) {
|
||||
if (typeof(val) === 'function') {
|
||||
val()
|
||||
}
|
||||
}
|
||||
})
|
||||
").expect("failed to evaluate window.onTauriInit");
|
||||
} else if !crate::endpoints::handle(webview, arg) {
|
||||
application.run_invoke_handler(webview, arg);
|
||||
|
||||
Reference in New Issue
Block a user