You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
console.warn("[TAURI] Couldn't find callback id {fn} in window. This happens when the app is reloaded while Rust is running an asynchronous operation.")
101
-
}}"#,
102
-
fn = function_name.0
103
-
)
95
+
format_raw_js(function_name.0, arg)
104
96
})
105
97
}
106
98
99
+
/// Formats a callback function invocation, properly accounting for error handling.
100
+
pubfnformat_raw_js(id:u32,js:&str) -> String{
101
+
format!(
102
+
r#"
103
+
if (window["_{id}"]) {{
104
+
window["_{id}"]({js})
105
+
}} else {{
106
+
console.warn("[TAURI] Couldn't find callback id {id} in window. This happens when the app is reloaded while Rust is running an asynchronous operation.")
107
+
}}"#
108
+
)
109
+
}
110
+
107
111
/// Formats a serializable Result type to its Promise response.
108
112
///
109
113
/// See [`format_result_raw`] for more information.
0 commit comments