diff --git a/web/selectors/nav-selectors.js b/web/selectors/nav-selectors.js --- a/web/selectors/nav-selectors.js +++ b/web/selectors/nav-selectors.js @@ -195,6 +195,23 @@ ); } +function useOnClickNewThread(): (event: SyntheticEvent) => void { + const dispatch = useDispatch(); + return React.useCallback( + (event: SyntheticEvent) => { + event.preventDefault(); + dispatch({ + type: updateNavInfoActionType, + payload: { + chatMode: 'create', + selectedUserList: [], + }, + }); + }, + [dispatch], + ); +} + function navTabSelector(state: AppState): NavigationTab { return state.navInfo.tab; } @@ -216,6 +233,7 @@ useOnClickThread, useThreadIsActive, useOnClickPendingSidebar, + useOnClickNewThread, navTabSelector, navSettingsSectionSelector, };