From f13ab8bf035827e8f8c297fcffaff6a6c33c61e1 Mon Sep 17 00:00:00 2001 From: "Erin E. Sullivan" Date: Thu, 29 Aug 2024 10:09:14 -0400 Subject: [PATCH] Changing initial state to `null`, as `state.a11y.message` was never being used. --- src/modules/a11y/components/A11yLiveMessage/index.js | 10 +++++++--- src/store.js | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/modules/a11y/components/A11yLiveMessage/index.js b/src/modules/a11y/components/A11yLiveMessage/index.js index 74dc9922..1d8b43d6 100644 --- a/src/modules/a11y/components/A11yLiveMessage/index.js +++ b/src/modules/a11y/components/A11yLiveMessage/index.js @@ -2,13 +2,17 @@ import React from 'react'; import { useSelector } from 'react-redux'; const A11yLiveMessage = () => { - const a11yMessage = useSelector((state) => { - return state.a11y.message; + const a11y = useSelector((state) => { + return state.a11y; }); + if (!a11y) { + return null; + } + return (
- {a11yMessage} + {a11y}
); }; diff --git a/src/store.js b/src/store.js index 4accb777..5a15fb4b 100644 --- a/src/store.js +++ b/src/store.js @@ -23,7 +23,7 @@ const store = configureStore({ return [...getDefaultMiddleware({ immutableCheck: false })]; }, reducer: { - a11y: simpleReducer(SET_A11Y_MESSAGE, { message: '' }), + a11y: simpleReducer(SET_A11Y_MESSAGE, null), advanced: advancedReducer, affiliation: affiliationReducer, browse: browseReducer,