5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-21 11:29:29 +08:00

Provide a way to initialise the runtime if not using any runtime features.

This commit is contained in:
Lea Anthony 2024-12-16 21:10:56 +11:00
parent 4dd920df0d
commit 19f60798b3
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405
2 changed files with 10 additions and 5 deletions

View File

@ -30,7 +30,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `app.OpenFileManager(path string, selectFile bool)` to open the system file manager to the path `path` with optional highlighting via `selectFile` by [@Krzysztofz01](https://github.com/Krzysztofz01) [@rcalixte](https://github.com/rcalixte)
- New `-git` flag for `wails3 init` command by [@leaanthony](https://github.com/leaanthony)
- New `wails3 generate webview2bootstrapper` command by [@leaanthony](https://github.com/leaanthony)2
- New `wails3 generate webview2bootstrapper` command by [@leaanthony](https://github.com/leaanthony)
- Added `init()` method in runtime to allow manual initialisation of the runtime by [@leaanthony](https://github.com/leaanthony)
### Fixed

View File

@ -43,12 +43,16 @@ export {
WML
};
var initialised = false;
let initialised = false;
export function init() {
window._wails.invoke = System.invoke;
System.invoke("wails:runtime:ready");
initialised = true;
}
window.addEventListener("load", () => {
if (!initialised) {
window._wails.invoke = System.invoke;
System.invoke("wails:runtime:ready");
initialised = true;
init();
}
});