From ad2fed8f0820a271c63399be55b12eedb303017d Mon Sep 17 00:00:00 2001 From: Rachel Chen Date: Wed, 1 Mar 2023 06:37:09 +0000 Subject: [PATCH] [v2] frontend/runtime/wrapper: return function return value in runtime wrapper (#2434) --- v2/internal/frontend/runtime/wrapper/runtime.js | 6 +++--- website/src/pages/changelog.mdx | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/v2/internal/frontend/runtime/wrapper/runtime.js b/v2/internal/frontend/runtime/wrapper/runtime.js index 63f69788b59..bd4f371ae1d 100644 --- a/v2/internal/frontend/runtime/wrapper/runtime.js +++ b/v2/internal/frontend/runtime/wrapper/runtime.js @@ -37,11 +37,11 @@ export function LogFatal(message) { } export function EventsOnMultiple(eventName, callback, maxCallbacks) { - window.runtime.EventsOnMultiple(eventName, callback, maxCallbacks); + return window.runtime.EventsOnMultiple(eventName, callback, maxCallbacks); } export function EventsOn(eventName, callback) { - EventsOnMultiple(eventName, callback, -1); + return EventsOnMultiple(eventName, callback, -1); } export function EventsOff(eventName, ...additionalEventNames) { @@ -49,7 +49,7 @@ export function EventsOff(eventName, ...additionalEventNames) { } export function EventsOnce(eventName, callback) { - EventsOnMultiple(eventName, callback, 1); + return EventsOnMultiple(eventName, callback, 1); } export function EventsEmit(eventName) { diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx index dec4e07ee48..e3d7f5617ed 100644 --- a/website/src/pages/changelog.mdx +++ b/website/src/pages/changelog.mdx @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed a segfault on opening the inspector on older macOS versions. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2397) - Fixed the macos single architecture builds not respecting an output file name specified with the '-o' flag. Fixed by @gwynforthewyn in [PR](https://github.com/wailsapp/wails/pull/2358) - Fixed `undo`/`redo` on macOS. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2430) +- Fixed `Events*` runtime functions in JavaScript not returning the function to cancel the watcher. Fixed by @zllovesuki in [PR](https://github.com/wailsapp/wails/pull/2434) ## v2.3.0 - 2022-12-29