diff --git a/web/types/nav-types.js b/web/types/nav-types.js --- a/web/types/nav-types.js +++ b/web/types/nav-types.js @@ -5,9 +5,10 @@ export type NavInfo = { ...$Exact, - +tab: 'calendar' | 'chat' | 'apps', + +tab: 'calendar' | 'chat' | 'apps' | 'settings', +activeChatThreadID: ?string, +pendingThread?: ThreadInfo, + +settingsSection?: 'account', }; export const updateNavInfoActionType = 'UPDATE_NAV_INFO'; diff --git a/web/url-utils.js b/web/url-utils.js --- a/web/url-utils.js +++ b/web/url-utils.js @@ -58,6 +58,8 @@ if (activeChatThreadID) { newURL += `thread/${activeChatThreadID}/`; } + } else if (navInfo.tab === 'settings' && navInfo.settingsSection) { + newURL += `${navInfo.settingsSection}/`; } } @@ -102,14 +104,25 @@ tab = 'calendar'; } else if (urlInfo.apps) { tab = 'apps'; + } else if (urlInfo.settings) { + tab = 'settings'; } - return { + const newNavInfo = { tab, startDate: startDateForYearAndMonth(year, month), endDate: endDateForYearAndMonth(year, month), activeChatThreadID, }; + + if (!urlInfo.settings) { + return newNavInfo; + } + + return { + ...newNavInfo, + settingsSection: urlInfo.settings, + }; } export { canonicalURLFromReduxState, navInfoFromURL };