Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3696661
D4466.id14394.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
868 B
Referenced Files
None
Subscribers
None
D4466.id14394.diff
View Options
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<HTMLElement>) => void {
+ const dispatch = useDispatch();
+ return React.useCallback(
+ (event: SyntheticEvent<HTMLElement>) => {
+ 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,
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 8, 12:45 PM (2 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2817522
Default Alt Text
D4466.id14394.diff (868 B)
Attached To
Mode
D4466: [web] Introduce `useOnClickNewThread` hook
Attached
Detach File
Event Timeline
Log In to Comment