From 81fbf35a32ca45497ff5c7872b8302c2efe46da0 Mon Sep 17 00:00:00 2001 From: wafflesvsfrankie <92288602+burtonemily@users.noreply.github.com> Date: Fri, 8 Nov 2024 16:55:59 +1100 Subject: [PATCH] fix: adds in globalUnreadMessageCount into the dependency array for useThrottleFn --- ts/components/leftpane/ActionsPanel.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ts/components/leftpane/ActionsPanel.tsx b/ts/components/leftpane/ActionsPanel.tsx index 1d6021434..4a67bc81b 100644 --- a/ts/components/leftpane/ActionsPanel.tsx +++ b/ts/components/leftpane/ActionsPanel.tsx @@ -244,13 +244,13 @@ export const ActionsPanel = () => { // Reuse the unreadToShow from the global state to update the badge count useThrottleFn( - () => { + (unreadCount: number) => { if (globalUnreadMessageCount !== undefined) { - ipcRenderer.send('update-badge-count', globalUnreadMessageCount); + ipcRenderer.send('update-badge-count', unreadCount); } }, 2000, - [] + [globalUnreadMessageCount] ); useInterval(cleanUpOldDecryptedMedias, startCleanUpMedia ? cleanUpMediasInterval : null);