From 86b7a984c7aad197c08a69bd26a2829ea67b76dd Mon Sep 17 00:00:00 2001 From: Piotr Witasik <55193208+PdoubleU@users.noreply.github.com> Date: Wed, 15 Nov 2023 11:13:30 +0100 Subject: [PATCH] fix: isModalNotification might be undefined (#227) * 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 }) })