Update Wails runtime and increase version

The Wails runtime has been updated to correctly handle debug checks and the version in the package.json has been bumped to 3.0.0-alpha.6. Fixed reference to global wails object in WML.
This commit is contained in:
Lea Anthony 2023-12-29 11:15:40 +11:00
commit 4c3cbc3535
No known key found for this signature in database
GPG key ID: 33DAF7BB90A58405
5 changed files with 14 additions and 5 deletions

View file

@ -0,0 +1 @@
events.test.js

View file

@ -11,6 +11,7 @@ The electron alternative for Go
/* jshint esversion: 9 */
import {newRuntimeCallerWithID, objectNames} from "./runtime";
import {IsDebug} from "./system";
const call = newRuntimeCallerWithID(objectNames.ContextMenu, '');
const ContextMenuOpen = 0;
@ -47,8 +48,9 @@ function contextMenuHandler(event) {
This rule is inherited like normal CSS rules, so nesting works as expected
*/
function processDefaultContextMenu(event) {
// Debug builds always show the menu
if (DEBUG) {
if (IsDebug()) {
return;
}

View file

@ -1,6 +1,6 @@
{
"name": "@wailsio/runtime",
"version": "3.0.0-alpha.4",
"version": "3.0.0-alpha.6",
"description": "Wails Runtime",
"main": "index.js",
"repository": {
@ -12,5 +12,6 @@
"bugs": {
"url": "https://github.com/wailsapp/wails/issues"
},
"homepage": "https://wails.io"
"homepage": "https://wails.io",
"private": false
}

View file

@ -116,3 +116,7 @@ export function IsARM() {
export function IsARM64() {
return environmentCache.Arch === "arm64";
}
export function IsDebug() {
return environmentCache.Debug === true;
}

View file

@ -2,6 +2,7 @@
import {Emit, WailsEvent} from "./events";
import {Question} from "./dialogs";
import {WindowMethods, Get} from "./window";
import {OpenURL} from "./browser";
/**
* Sends an event with the given name and optional data.
@ -119,12 +120,12 @@ function addWMLOpenBrowserListener() {
if (confirm) {
Question({Title: "Confirm", Message:confirm, Buttons:[{Label:"Yes"},{Label:"No", IsDefault:true}]}).then(function (result) {
if (result !== "No") {
void wails.Browser.OpenURL(url);
void OpenURL(url);
}
});
return;
}
void wails.Browser.OpenURL(url);
void OpenURL(url);
};
// Remove existing listeners