Skip to content

Commit

Permalink
Changing initial state to null, as state.a11y.message was never b…
Browse files Browse the repository at this point in the history
…eing used.
  • Loading branch information
erinesullivan committed Aug 29, 2024
1 parent 5f1ea45 commit f13ab8b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/modules/a11y/components/A11yLiveMessage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div role='status' aria-atomic='true' aria-live='polite' className='offpage'>
<span>{a11yMessage}</span>
{a11y}
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f13ab8b

Please sign in to comment.