diff --git a/web/app.react.js b/web/app.react.js --- a/web/app.react.js +++ b/web/app.react.js @@ -31,6 +31,7 @@ import LoadingIndicator from './loading-indicator.react'; import { MenuProvider } from './menu-provider.react'; import { ModalProvider, useModalContext } from './modals/modal-provider.react'; +import { updateNavInfoActionType } from './redux/action-types'; import DeviceIDUpdater from './redux/device-id-updater'; import DisconnectedBar from './redux/disconnected-bar'; import DisconnectedBarVisibilityHandler from './redux/disconnected-bar-visibility-handler'; @@ -45,7 +46,7 @@ import './typography.css'; import css from './style.css'; import getTitle from './title/getTitle'; -import { type NavInfo, updateNavInfoActionType } from './types/nav-types'; +import { type NavInfo } from './types/nav-types'; import { canonicalURLFromReduxState, navInfoFromURL } from './url-utils'; // We want Webpack's css-loader and style-loader to handle the Fontawesome CSS, diff --git a/web/chat/chat-message-list-container.react.js b/web/chat/chat-message-list-container.react.js --- a/web/chat/chat-message-list-container.react.js +++ b/web/chat/chat-message-list-container.react.js @@ -20,8 +20,8 @@ import type { AccountUserInfo } from 'lib/types/user-types'; import { InputStateContext } from '../input/input-state'; +import { updateNavInfoActionType } from '../redux/action-types'; import { useSelector } from '../redux/redux-utils'; -import { updateNavInfoActionType } from '../types/nav-types'; import ChatInputBar from './chat-input-bar.react'; import css from './chat-message-list-container.css'; import ChatMessageList from './chat-message-list.react'; diff --git a/web/chat/chat-thread-composer.react.js b/web/chat/chat-thread-composer.react.js --- a/web/chat/chat-thread-composer.react.js +++ b/web/chat/chat-thread-composer.react.js @@ -10,9 +10,9 @@ import Label from '../components/label.react'; import Search from '../components/search.react'; import type { InputState } from '../input/input-state'; +import { updateNavInfoActionType } from '../redux/action-types'; import { useSelector } from '../redux/redux-utils'; import SWMansionIcon from '../SWMansionIcon.react'; -import { updateNavInfoActionType } from '../types/nav-types'; import css from './chat-thread-composer.css'; type Props = { diff --git a/web/chat/robotext-message.react.js b/web/chat/robotext-message.react.js --- a/web/chat/robotext-message.react.js +++ b/web/chat/robotext-message.react.js @@ -13,8 +13,8 @@ import Markdown from '../markdown/markdown.react'; import { linkRules } from '../markdown/rules.react'; +import { updateNavInfoActionType } from '../redux/action-types'; import { useSelector } from '../redux/redux-utils'; -import { updateNavInfoActionType } from '../types/nav-types'; import { InlineSidebar } from './inline-sidebar.react'; import MessageTooltip from './message-tooltip.react'; import type { diff --git a/web/redux/action-types.js b/web/redux/action-types.js --- a/web/redux/action-types.js +++ b/web/redux/action-types.js @@ -1,4 +1,6 @@ // @flow +export const updateNavInfoActionType = 'UPDATE_NAV_INFO'; +export const updateWindowDimensionsActionType = 'UPDATE_WINDOW_DIMENSIONS'; export const updateWindowActiveActionType = 'UPDATE_WINDOW_ACTIVE'; export const setDeviceIDActionType = 'SET_DEVICE_ID'; diff --git a/web/redux/nav-reducer.js b/web/redux/nav-reducer.js --- a/web/redux/nav-reducer.js +++ b/web/redux/nav-reducer.js @@ -4,8 +4,9 @@ import { threadIsPending } from 'lib/shared/thread-utils'; import type { RawThreadInfo } from 'lib/types/thread-types'; +import { updateNavInfoActionType } from '../redux/action-types'; import type { Action } from '../redux/redux-setup'; -import { type NavInfo, updateNavInfoActionType } from '../types/nav-types'; +import { type NavInfo } from '../types/nav-types'; export default function reduceNavInfo( oldState: NavInfo, diff --git a/web/redux/redux-setup.js b/web/redux/redux-setup.js --- a/web/redux/redux-setup.js +++ b/web/redux/redux-setup.js @@ -26,10 +26,12 @@ import { setNewSessionActionType } from 'lib/utils/action-utils'; import { activeThreadSelector } from '../selectors/nav-selectors'; -import { type NavInfo, updateNavInfoActionType } from '../types/nav-types'; +import { type NavInfo } from '../types/nav-types'; import { updateWindowActiveActionType, setDeviceIDActionType, + updateNavInfoActionType, + updateWindowDimensionsActionType, } from './action-types'; import { reduceDeviceID } from './device-id-reducer'; import reduceNavInfo from './nav-reducer'; @@ -66,8 +68,6 @@ _persist: ?PersistState, }; -export const updateWindowDimensions = 'UPDATE_WINDOW_DIMENSIONS'; - export type Action = | BaseAction | { type: 'UPDATE_NAV_INFO', payload: Shape } @@ -88,7 +88,7 @@ invariant(oldState, 'should be set'); let state = oldState; - if (action.type === updateWindowDimensions) { + if (action.type === updateWindowDimensionsActionType) { return validateState(oldState, { ...state, windowDimensions: action.payload, 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 @@ -17,12 +17,12 @@ import type { ThreadInfo } from 'lib/types/thread-types'; import { getDefaultTextMessageRules } from '../markdown/rules.react'; +import { updateNavInfoActionType } from '../redux/action-types'; import type { AppState } from '../redux/redux-setup'; import { useSelector } from '../redux/redux-utils'; import { type NavigationTab, type NavigationSettingsSection, - updateNavInfoActionType, } from '../types/nav-types'; const dateExtractionRegex = /^([0-9]{4})-([0-9]{2})-[0-9]{2}$/; diff --git a/web/sidebar/app-switcher.react.js b/web/sidebar/app-switcher.react.js --- a/web/sidebar/app-switcher.react.js +++ b/web/sidebar/app-switcher.react.js @@ -8,10 +8,10 @@ unreadCount, } from 'lib/selectors/thread-selectors'; +import { updateNavInfoActionType } from '../redux/action-types'; import { useSelector } from '../redux/redux-utils'; import { navTabSelector } from '../selectors/nav-selectors.js'; import SWMansionIcon from '../SWMansionIcon.react'; -import { updateNavInfoActionType } from '../types/nav-types'; import css from './left-layout-aside.css'; import NavigationPanel from './navigation-panel.react'; diff --git a/web/sidebar/community-picker.react.js b/web/sidebar/community-picker.react.js --- a/web/sidebar/community-picker.react.js +++ b/web/sidebar/community-picker.react.js @@ -5,9 +5,9 @@ import { useDispatch } from 'react-redux'; import Button from '../components/button.react'; +import { updateNavInfoActionType } from '../redux/action-types.js'; import { useSelector } from '../redux/redux-utils.js'; import SWMansionIcon from '../SWMansionIcon.react'; -import { updateNavInfoActionType } from '../types/nav-types.js'; import css from './community-picker.css'; function CommunityPicker(): React.Node { diff --git a/web/sidebar/settings-switcher.react.js b/web/sidebar/settings-switcher.react.js --- a/web/sidebar/settings-switcher.react.js +++ b/web/sidebar/settings-switcher.react.js @@ -3,8 +3,8 @@ import * as React from 'react'; import { useDispatch } from 'react-redux'; +import { updateNavInfoActionType } from '../redux/action-types'; import { navSettingsSectionSelector } from '../selectors/nav-selectors.js'; -import { updateNavInfoActionType } from '../types/nav-types'; import css from './left-layout-aside.css'; import NavigationPanel from './navigation-panel.react'; 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 @@ -18,5 +18,3 @@ +selectedUserList?: $ReadOnlyArray, +chatMode?: NavigationChatMode, }; - -export const updateNavInfoActionType = 'UPDATE_NAV_INFO';