diff --git a/web/chat/sidebar-item.react.js b/web/chat/sidebar-item.react.js index 2728e9c50..88a159949 100644 --- a/web/chat/sidebar-item.react.js +++ b/web/chat/sidebar-item.react.js @@ -1,35 +1,40 @@ // @flow import classNames from 'classnames'; import * as React from 'react'; import type { SidebarInfo } from 'lib/types/thread-types'; import { useOnClickThread } from '../selectors/nav-selectors'; import SWMansionIcon from '../SWMansionIcon.react'; import css from './chat-thread-list.css'; type Props = { +sidebarInfo: SidebarInfo, }; function SidebarItem(props: Props): React.Node { - const { threadInfo } = props.sidebarInfo; + const { + sidebarInfo: { threadInfo }, + } = props; + const { + currentUser: { unread }, + } = threadInfo; + const onClick = useOnClickThread(threadInfo); - const { unread } = threadInfo.currentUser; const unreadCls = classNames(css.sidebarTitle, { [css.unread]: unread }); return ( <>
{threadInfo.uiName}
); } export default SidebarItem;