Browse Source

fix linting indexing issue

pull/3469/head
Riya Bhatia 2 years ago
parent
commit
c7cab4e653
  1. 3
      web/components/chat/ChatContainer/ChatContainer.tsx

3
web/components/chat/ChatContainer/ChatContainer.tsx

@ -320,7 +320,8 @@ export const ChatContainer: FC<ChatContainerProps> = ({ @@ -320,7 +320,8 @@ export const ChatContainer: FC<ChatContainerProps> = ({
// Retrieve, clean, and attach username to newest chat message to be read out by screenreader
function getLastMessage() {
if (messages.length > 0 && typeof messages[messages.length - 1].body !== 'undefined') {
const stringToRead = `${usernameToHighlight} said ${messages[messages.length - 1].body.replace(/(<([^>]+)>)/gi, '')}`;
const message = messages[messages.length - 1].body.replace(/(<([^>]+)>)/gi, '');
const stringToRead = `${usernameToHighlight} said ${message}`;
return stringToRead;
}
return '';

Loading…
Cancel
Save