From 099e1d3767c0e5a3f5d415c6a7e89435fce29539 Mon Sep 17 00:00:00 2001 From: Jamey Huffnagle Date: Fri, 16 Feb 2024 08:06:01 -0500 Subject: [PATCH] clean up callback --- app/src/redux/shell/remote.ts | 4 ++-- app/src/resources/useNotifyService.ts | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/redux/shell/remote.ts b/app/src/redux/shell/remote.ts index 093ae1f4b92..06270457867 100644 --- a/app/src/redux/shell/remote.ts +++ b/app/src/redux/shell/remote.ts @@ -40,13 +40,13 @@ export function appShellRequestor( export function appShellListener( hostname: string | null, topic: NotifyTopic, - listenerCb: (data: NotifyResponseData) => void + callback: (data: NotifyResponseData) => void ): void { remote.ipcRenderer.on( 'notify', (_, shellHostname, shellTopic, shellMessage) => { if (hostname === shellHostname && topic === shellTopic) { - listenerCb(shellMessage) + callback(shellMessage) } } ) diff --git a/app/src/resources/useNotifyService.ts b/app/src/resources/useNotifyService.ts index 05a73337cae..2b114cf5bc0 100644 --- a/app/src/resources/useNotifyService.ts +++ b/app/src/resources/useNotifyService.ts @@ -46,8 +46,7 @@ export function useNotifyService({ hostname != null && staleTime !== Infinity ) { - const listenerCb = (data: NotifyResponseData): void => onDataEvent(data) - appShellListener(hostname, topic, listenerCb) + appShellListener(hostname, topic, onDataEvent) dispatch(notifySubscribeAction(hostname, topic)) return () => {