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