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:
parent
4dd920df0d
commit
19f60798b3
@ -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
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user