diff --git a/web/types/nav-types.js b/web/types/nav-types.js index 8f7344e2e..8b49a0b29 100644 --- a/web/types/nav-types.js +++ b/web/types/nav-types.js @@ -1,60 +1,60 @@ // @flow import type { TInterface } from 'tcomb'; import t from 'tcomb'; import { threadInfoValidator } from 'lib/permissions/minimally-encoded-thread-permissions-validators.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { type BaseNavInfo } from 'lib/types/nav-types.js'; import { type AccountUserInfo, accountUserInfoValidator, } from 'lib/types/user-types.js'; import { tID, tShape } from 'lib/utils/validation-utils.js'; export type WebNavigationTab = 'calendar' | 'chat' | 'settings'; const webNavigationTabValidator = t.enums.of(['calendar', 'chat', 'settings']); export type WebLoginMethod = 'form' | 'qr-code'; const webLoginMethodValidator = t.enums.of(['form', 'qr-code']); export type WebNavigationSettingsSection = | 'account' | 'friend-list' | 'block-list' | 'keyservers' | 'danger-zone'; const webNavigationSettingsSectionValidator = t.enums.of([ 'account', 'friend-list', 'block-list', 'keyservers', 'danger-zone', ]); -export type NavigationChatMode = 'view' | 'create'; -const navigationChatModeValidator = t.enums.of(['view', 'create']); +export type WebNavigationChatMode = 'view' | 'create'; +const webNavigationChatModeValidator = t.enums.of(['view', 'create']); export type NavInfo = { ...$Exact, +tab: WebNavigationTab, +activeChatThreadID: ?string, +pendingThread?: ThreadInfo, +settingsSection?: WebNavigationSettingsSection, +selectedUserList?: $ReadOnlyArray, - +chatMode?: NavigationChatMode, + +chatMode?: WebNavigationChatMode, +inviteSecret?: ?string, +loginMethod?: WebLoginMethod, }; export const navInfoValidator: TInterface = tShape<$Exact>({ startDate: t.String, endDate: t.String, tab: webNavigationTabValidator, activeChatThreadID: t.maybe(tID), pendingThread: t.maybe(threadInfoValidator), settingsSection: t.maybe(webNavigationSettingsSectionValidator), selectedUserList: t.maybe(t.list(accountUserInfoValidator)), - chatMode: t.maybe(navigationChatModeValidator), + chatMode: t.maybe(webNavigationChatModeValidator), inviteSecret: t.maybe(t.String), loginMethod: t.maybe(webLoginMethodValidator), });