From bf82434915ecaa7eebcf1aa5a8934938a933acb7 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Tue, 18 Feb 2025 11:26:18 +0100 Subject: [PATCH] windy-plugin: sync API --- libs/windy-sounding/src/sounding.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/windy-sounding/src/sounding.tsx b/libs/windy-sounding/src/sounding.tsx index c5c5192d..948a5434 100644 --- a/libs/windy-sounding/src/sounding.tsx +++ b/libs/windy-sounding/src/sounding.tsx @@ -27,6 +27,7 @@ const { emitter: windyPicker } = W.picker; const windyRootScope = W.rootScope; const { singleclick } = W.singleclick; const favs = W.userFavs; +const broadcast = W.broadcast; let appContainer: HTMLElement; let resizeObserver: ResizeObserver | undefined; @@ -103,11 +104,11 @@ export const mountPlugin = (container: HTMLElement) => { addSubscription(() => windyPicker.off(pickerMovedEventId)); } - const favsChangedEventId = favs.on('favsChanged', () => { + const favChangedEventId = broadcast.on('favChanged', () => { dispatch(pluginSlice.setFavorites(favs.getArray())); }); - addSubscription(() => favs.off(favsChangedEventId)); + addSubscription(() => broadcast.off(favChangedEventId)); }; // Called when the plugin is opened