mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-01 12:24:16 +00:00
Remove unnecessary try / catch blocks when using the winit-based wasm-preview
Commitb2645dff6cand4b37d9a1f1introduced the use of spawn, which doesn't thrown anymore.
This commit is contained in:
parent
6aa4c691f0
commit
33561b0457
3 changed files with 3 additions and 19 deletions
|
|
@ -85,15 +85,7 @@
|
|||
async function run() {
|
||||
await slint.default();
|
||||
|
||||
try {
|
||||
slint.run_event_loop();
|
||||
// this will trigger a JS exception, so this line will never be reached!
|
||||
} catch (e) {
|
||||
// The winit event loop, when targeting wasm, throws a JavaScript exception to break out of
|
||||
// Rust without running any destructors. Don't rethrow the exception but swallow it, as
|
||||
// this is no error and we truly want to resolve the promise of this function by returning
|
||||
// the model markers.
|
||||
}
|
||||
slint.run_event_loop();
|
||||
|
||||
let selector = ["code.language-slint", ".rustdoc pre.language-slint", "div.highlight-slint div.highlight", "div.highlight-slint\\,no-auto-preview div.highlight"]
|
||||
.map((sel) => `${sel}:not([class*=slint\\,ignore]):not([class*=slint\\,no-preview])`).join(",");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue