From 5b357a35b8ae2957f113b14c56a535062d62a9bf Mon Sep 17 00:00:00 2001 From: PdoubleU Date: Wed, 15 Nov 2023 11:04:29 +0100 Subject: [PATCH] * add optional chaining for possible undefined isModalNotification --- src/core/hooks/useNotificationEventHandler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/hooks/useNotificationEventHandler.ts b/src/core/hooks/useNotificationEventHandler.ts index 90d6ab1d..48e8aade 100644 --- a/src/core/hooks/useNotificationEventHandler.ts +++ b/src/core/hooks/useNotificationEventHandler.ts @@ -23,7 +23,7 @@ export const useNotificationEventHandler = ({ useEffect(() => { const removeListener = emitter.addListener('add_notification', (config: EmitParam) => { - if (!isModalProvider && config.params.isModalNotification) return + if (!isModalProvider && config.params?.isModalNotification) return dispatch({ type: 'add', payload: config }) })