diff --git a/web/avatars/edit-thread-avatar-menu.react.js b/web/avatars/edit-thread-avatar-menu.react.js --- a/web/avatars/edit-thread-avatar-menu.react.js +++ b/web/avatars/edit-thread-avatar-menu.react.js @@ -10,7 +10,6 @@ ThreadInfo, RawThreadInfo, } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useUploadAvatarMedia } from './avatar-hooks.react.js'; import css from './edit-avatar-menu.css'; @@ -26,7 +25,7 @@ ); type Props = { - +threadInfo: RawThreadInfo | LegacyThreadInfo | ThreadInfo, + +threadInfo: RawThreadInfo | ThreadInfo, }; function EditThreadAvatarMenu(props: Props): React.Node { const { threadInfo } = props; diff --git a/web/avatars/edit-thread-avatar.react.js b/web/avatars/edit-thread-avatar.react.js --- a/web/avatars/edit-thread-avatar.react.js +++ b/web/avatars/edit-thread-avatar.react.js @@ -10,14 +10,13 @@ RawThreadInfo, } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import EditThreadAvatarMenu from './edit-thread-avatar-menu.react.js'; import css from './edit-thread-avatar.css'; import ThreadAvatar from './thread-avatar.react.js'; type Props = { - +threadInfo: RawThreadInfo | LegacyThreadInfo | ThreadInfo, + +threadInfo: RawThreadInfo | ThreadInfo, +disabled?: boolean, }; function EditThreadAvatar(props: Props): React.Node { diff --git a/web/avatars/thread-avatar.react.js b/web/avatars/thread-avatar.react.js --- a/web/avatars/thread-avatar.react.js +++ b/web/avatars/thread-avatar.react.js @@ -13,13 +13,12 @@ RawThreadInfo, } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import Avatar from './avatar.react.js'; import { useSelector } from '../redux/redux-utils.js'; type Props = { - +threadInfo: RawThreadInfo | LegacyThreadInfo | ThreadInfo, + +threadInfo: RawThreadInfo | ThreadInfo, +size: AvatarSize, +showSpinner?: boolean, }; diff --git a/web/avatars/thread-emoji-avatar-selection-modal.react.js b/web/avatars/thread-emoji-avatar-selection-modal.react.js --- a/web/avatars/thread-emoji-avatar-selection-modal.react.js +++ b/web/avatars/thread-emoji-avatar-selection-modal.react.js @@ -16,12 +16,11 @@ ThreadInfo, RawThreadInfo, } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import EmojiAvatarSelectionModal from './emoji-avatar-selection-modal.react.js'; type Props = { - +threadInfo: RawThreadInfo | LegacyThreadInfo | ThreadInfo, + +threadInfo: RawThreadInfo | ThreadInfo, }; function ThreadEmojiAvatarSelectionModal(props: Props): React.Node { diff --git a/web/calendar/day.react.js b/web/calendar/day.react.js --- a/web/calendar/day.react.js +++ b/web/calendar/day.react.js @@ -18,7 +18,6 @@ import type { EntryInfo } from 'lib/types/entry-types.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { Dispatch } from 'lib/types/redux-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { dateFromString, dateString } from 'lib/utils/date-utils.js'; import { useDispatch } from 'lib/utils/redux-utils.js'; @@ -39,7 +38,7 @@ }; type Props = { ...BaseProps, - +onScreenThreadInfos: $ReadOnlyArray, + +onScreenThreadInfos: $ReadOnlyArray, +viewerID: ?string, +loggedIn: boolean, +nextLocalID: number, diff --git a/web/chat/chat-thread-list-item-menu.react.js b/web/chat/chat-thread-list-item-menu.react.js --- a/web/chat/chat-thread-list-item-menu.react.js +++ b/web/chat/chat-thread-list-item-menu.react.js @@ -6,14 +6,13 @@ import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; import useToggleUnreadStatus from 'lib/hooks/toggle-unread-status.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import css from './chat-thread-list-item-menu.css'; import Button from '../components/button.react.js'; import { useThreadIsActive } from '../selectors/thread-selectors.js'; type Props = { - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, +mostRecentNonLocalMessage: ?string, +renderStyle?: 'chat' | 'thread', }; diff --git a/web/chat/chat-thread-list-see-more-sidebars.react.js b/web/chat/chat-thread-list-see-more-sidebars.react.js --- a/web/chat/chat-thread-list-see-more-sidebars.react.js +++ b/web/chat/chat-thread-list-see-more-sidebars.react.js @@ -6,13 +6,12 @@ import { useModalContext } from 'lib/components/modal-provider.react.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import css from './chat-thread-list.css'; import SidebarsModal from '../modals/threads/sidebars/sidebars-modal.react.js'; type Props = { - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, +unread: boolean, }; function ChatThreadListSeeMoreSidebars(props: Props): React.Node { diff --git a/web/chat/inline-engagement.react.js b/web/chat/inline-engagement.react.js --- a/web/chat/inline-engagement.react.js +++ b/web/chat/inline-engagement.react.js @@ -8,7 +8,6 @@ import { getInlineEngagementSidebarText } from 'lib/shared/inline-engagement-utils.js'; import type { MessageInfo } from 'lib/types/message-types.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import css from './inline-engagement.css'; import ReactionPill from './reaction-pill.react.js'; @@ -17,8 +16,8 @@ type Props = { +messageInfo: MessageInfo, - +threadInfo: LegacyThreadInfo | ThreadInfo, - +sidebarThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, + +threadInfo: ThreadInfo, + +sidebarThreadInfo: ?ThreadInfo, +reactions: ReactionInfo, +positioning: 'left' | 'center' | 'right', +label?: ?string, diff --git a/web/chat/message-preview.react.js b/web/chat/message-preview.react.js --- a/web/chat/message-preview.react.js +++ b/web/chat/message-preview.react.js @@ -8,14 +8,13 @@ import { useMessagePreview } from 'lib/shared/message-utils.js'; import { type MessageInfo } from 'lib/types/message-types.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import css from './chat-thread-list.css'; import { getDefaultTextMessageRules } from '../markdown/rules.react.js'; type Props = { +messageInfo: ?MessageInfo, - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, }; function MessagePreview(props: Props): React.Node { const { messageInfo, threadInfo } = props; diff --git a/web/chat/relationship-prompt/relationship-prompt.js b/web/chat/relationship-prompt/relationship-prompt.js --- a/web/chat/relationship-prompt/relationship-prompt.js +++ b/web/chat/relationship-prompt/relationship-prompt.js @@ -11,13 +11,12 @@ import { useRelationshipPrompt } from 'lib/hooks/relationship-prompt.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { userRelationshipStatus } from 'lib/types/relationship-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import RelationshipPromptButtonContainer from './relationship-prompt-button-container.js'; import RelationshipPromptButton from './relationship-prompt-button.js'; import { buttonThemes } from '../../components/button.react.js'; -type Props = { +threadInfo: LegacyThreadInfo | ThreadInfo }; +type Props = { +threadInfo: ThreadInfo }; function RelationshipPrompt(props: Props) { const { threadInfo } = 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 @@ -7,7 +7,6 @@ import { threadInfoSelector } from 'lib/selectors/thread-selectors.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { Dispatch } from 'lib/types/redux-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { entityTextToReact, useENSNamesForEntityText, @@ -101,7 +100,7 @@ }; type InnerThreadEntityProps = { ...BaseInnerThreadEntityProps, - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, +dispatch: Dispatch, }; class InnerThreadEntity extends React.PureComponent { diff --git a/web/input/input-state-container.react.js b/web/input/input-state-container.react.js --- a/web/input/input-state-container.react.js +++ b/web/input/input-state-container.react.js @@ -80,7 +80,6 @@ import { type ClientNewThreadRequest, type NewThreadResult, - type LegacyThreadInfo, } from 'lib/types/thread-types.js'; import { useLegacyAshoatKeyserverCall } from 'lib/utils/action-utils.js'; import { @@ -420,7 +419,7 @@ return rawMessageInfo; } - shouldEncryptMedia(threadInfo: LegacyThreadInfo | ThreadInfo): boolean { + shouldEncryptMedia(threadInfo: ThreadInfo): boolean { return threadInfoInsideCommunity(threadInfo, commStaffCommunity.id); } @@ -566,9 +565,7 @@ } } - startThreadCreation( - threadInfo: LegacyThreadInfo | ThreadInfo, - ): Promise { + startThreadCreation(threadInfo: ThreadInfo): Promise { if (!threadIsPending(threadInfo.id)) { return Promise.resolve(threadInfo.id); } @@ -629,7 +626,7 @@ draft: draft ?? '', textCursorPosition: textCursorPosition ?? 0, appendFiles: ( - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, files: $ReadOnlyArray, ) => this.appendFiles(threadInfo, files), cancelPendingUpload: (localUploadID: string) => @@ -642,7 +639,7 @@ this.sendTextMessage(messageInfo, threadInfo, parentThreadInfo), createMultimediaMessage: ( localID: number, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, ) => this.createMultimediaMessage(localID, threadInfo), setDraft: (newDraft: string) => this.setDraft(threadID, newDraft), setTextCursorPosition: (newPosition: number) => @@ -651,7 +648,7 @@ this.messageHasUploadFailure(assignedUploads[localMessageID]), retryMultimediaMessage: ( localMessageID: string, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, ) => this.retryMultimediaMessage( localMessageID, @@ -690,7 +687,7 @@ } async appendFiles( - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, files: $ReadOnlyArray, ): Promise { const selectionTime = Date.now(); @@ -747,7 +744,7 @@ } async appendFile( - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, file: File, selectTime: number, ): Promise<{ @@ -1342,8 +1339,8 @@ async sendTextMessageAction( messageInfo: RawTextMessageInfo, - threadInfo: LegacyThreadInfo | ThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, + threadInfo: ThreadInfo, + parentThreadInfo: ?ThreadInfo, ): Promise { try { await this.props.textMessageCreationSideEffectsFunc( @@ -1382,10 +1379,7 @@ // Creates a MultimediaMessage from the unassigned pending uploads, // if there are any - createMultimediaMessage( - localID: number, - threadInfo: LegacyThreadInfo | ThreadInfo, - ) { + createMultimediaMessage(localID: number, threadInfo: ThreadInfo) { this.props.sendCallbacks.forEach(callback => callback()); const localMessageID = `${localIDPrefix}${localID}`; @@ -1506,7 +1500,7 @@ retryMultimediaMessage( localMessageID: string, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, pendingUploads: ?$ReadOnlyArray, ) { this.props.sendCallbacks.forEach(callback => callback()); diff --git a/web/input/input-state.js b/web/input/input-state.js --- a/web/input/input-state.js +++ b/web/input/input-state.js @@ -12,7 +12,6 @@ import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ChatMentionCandidates, - LegacyThreadInfo, RelativeMemberInfo, } from 'lib/types/thread-types.js'; @@ -64,7 +63,7 @@ +draft: string, +textCursorPosition: number, +appendFiles: ( - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, files: $ReadOnlyArray, ) => Promise, +cancelPendingUpload: (localUploadID: string) => void, @@ -73,16 +72,13 @@ threadInfo: ThreadInfo, parentThreadInfo: ?ThreadInfo, ) => mixed, - +createMultimediaMessage: ( - localID: number, - threadInfo: LegacyThreadInfo | ThreadInfo, - ) => void, + +createMultimediaMessage: (localID: number, threadInfo: ThreadInfo) => void, +setDraft: (draft: string) => void, +setTextCursorPosition: (newPosition: number) => void, +messageHasUploadFailure: (localMessageID: string) => boolean, +retryMultimediaMessage: ( localMessageID: string, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, ) => void, +addReply: (text: string) => void, +addReplyListener: ((message: string) => void) => void, diff --git a/web/invite-links/manage/edit-link-modal.react.js b/web/invite-links/manage/edit-link-modal.react.js --- a/web/invite-links/manage/edit-link-modal.react.js +++ b/web/invite-links/manage/edit-link-modal.react.js @@ -12,7 +12,6 @@ } from 'lib/shared/invite-links.js'; import type { InviteLink } from 'lib/types/link-types.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import css from './manage-invite-links-modal.css'; import Button from '../../components/button.react.js'; @@ -23,7 +22,7 @@ +inviteLink: ?InviteLink, +enterViewMode: () => mixed, +enterDisableMode: () => mixed, - +community: LegacyThreadInfo | ThreadInfo, + +community: ThreadInfo, }; const disableButtonColor = { diff --git a/web/markdown/rules.react.js b/web/markdown/rules.react.js --- a/web/markdown/rules.react.js +++ b/web/markdown/rules.react.js @@ -7,10 +7,7 @@ import * as SharedMarkdown from 'lib/shared/markdown.js'; import { chatMentionRegex } from 'lib/shared/mention-utils.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { - ChatMentionCandidates, - LegacyThreadInfo, -} from 'lib/types/thread-types.js'; +import type { ChatMentionCandidates } from 'lib/types/thread-types.js'; import MarkdownChatMention from './markdown-chat-mention.react.js'; import MarkdownSpoiler from './markdown-spoiler.react.js'; @@ -162,7 +159,7 @@ }); function useTextMessageRulesFunc( - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, chatMentionCandidates: ChatMentionCandidates, ): boolean => MarkdownRules { const { members } = threadInfo; diff --git a/web/modals/search/message-search-utils.react.js b/web/modals/search/message-search-utils.react.js --- a/web/modals/search/message-search-utils.react.js +++ b/web/modals/search/message-search-utils.react.js @@ -13,12 +13,11 @@ import { filterChatMessageInfosForSearch } from 'lib/shared/search-utils.js'; import type { RawMessageInfo } from 'lib/types/message-types.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useSelector } from '../../redux/redux-utils.js'; function useParseSearchResults( - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, searchResults: $ReadOnlyArray, ): $ReadOnlyArray { const userInfos = useSelector(state => state.userStore.userInfos); diff --git a/web/modals/threads/create/steps/subchannel-members-list.react.js b/web/modals/threads/create/steps/subchannel-members-list.react.js --- a/web/modals/threads/create/steps/subchannel-members-list.react.js +++ b/web/modals/threads/create/steps/subchannel-members-list.react.js @@ -5,10 +5,7 @@ import { useENSNames } from 'lib/hooks/ens-cache.js'; import { stringForUser } from 'lib/shared/user-utils.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { - LegacyThreadInfo, - RelativeMemberInfo, -} from 'lib/types/thread-types.js'; +import type { RelativeMemberInfo } from 'lib/types/thread-types.js'; import type { UserListItem } from 'lib/types/user-types.js'; import { useSelector } from '../../../../redux/redux-utils.js'; @@ -17,8 +14,8 @@ type Props = { +searchText: string, +searchResult: $ReadOnlySet, - +communityThreadInfo: LegacyThreadInfo | ThreadInfo, - +parentThreadInfo: LegacyThreadInfo | ThreadInfo, + +communityThreadInfo: ThreadInfo, + +parentThreadInfo: ThreadInfo, +selectedUsers: $ReadOnlySet, +toggleUserSelection: (userID: string) => void, }; diff --git a/web/modals/threads/gallery/thread-settings-media-gallery.react.js b/web/modals/threads/gallery/thread-settings-media-gallery.react.js --- a/web/modals/threads/gallery/thread-settings-media-gallery.react.js +++ b/web/modals/threads/gallery/thread-settings-media-gallery.react.js @@ -11,7 +11,6 @@ } from 'lib/media/media-utils.js'; import type { Media } from 'lib/types/media-types.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import GalleryItem from './thread-settings-media-gallery-item.react.js'; import css from './thread-settings-media-gallery.css'; @@ -38,7 +37,7 @@ type ThreadSettingsMediaGalleryModalProps = { +onClose: () => void, - +parentThreadInfo: LegacyThreadInfo | ThreadInfo, + +parentThreadInfo: ThreadInfo, +limit: number, +activeTab: MediaGalleryTab, }; diff --git a/web/modals/threads/members/change-member-role-modal.react.js b/web/modals/threads/members/change-member-role-modal.react.js --- a/web/modals/threads/members/change-member-role-modal.react.js +++ b/web/modals/threads/members/change-member-role-modal.react.js @@ -12,10 +12,7 @@ import { otherUsersButNoOtherAdmins } from 'lib/selectors/thread-selectors.js'; import { roleIsAdminRole } from 'lib/shared/thread-utils.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { - LegacyThreadInfo, - RelativeMemberInfo, -} from 'lib/types/thread-types'; +import type { RelativeMemberInfo } from 'lib/types/thread-types'; import { values } from 'lib/utils/objects.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; @@ -29,7 +26,7 @@ type ChangeMemberRoleModalProps = { +memberInfo: RelativeMemberInfo, - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, }; function ChangeMemberRoleModal(props: ChangeMemberRoleModalProps): React.Node { diff --git a/web/modals/threads/members/member.react.js b/web/modals/threads/members/member.react.js --- a/web/modals/threads/members/member.react.js +++ b/web/modals/threads/members/member.react.js @@ -12,10 +12,7 @@ import { stringForUser } from 'lib/shared/user-utils.js'; import type { SetState } from 'lib/types/hook-types.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { - LegacyThreadInfo, - RelativeMemberInfo, -} from 'lib/types/thread-types.js'; +import type { RelativeMemberInfo } from 'lib/types/thread-types.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; import { useRolesFromCommunityThreadInfo } from 'lib/utils/role-utils.js'; @@ -32,7 +29,7 @@ type Props = { +memberInfo: RelativeMemberInfo, - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, +setOpenMenu: SetState, }; diff --git a/web/modals/threads/members/members-list.react.js b/web/modals/threads/members/members-list.react.js --- a/web/modals/threads/members/members-list.react.js +++ b/web/modals/threads/members/members-list.react.js @@ -8,16 +8,13 @@ import { useENSNames } from 'lib/hooks/ens-cache.js'; import { stringForUser } from 'lib/shared/user-utils.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import { - type RelativeMemberInfo, - type LegacyThreadInfo, -} from 'lib/types/thread-types.js'; +import { type RelativeMemberInfo } from 'lib/types/thread-types.js'; import ThreadMember from './member.react.js'; import css from './members-modal.css'; type Props = { - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, +threadMembers: $ReadOnlyArray, }; diff --git a/web/modals/threads/settings/thread-settings-delete-confirmation-modal.react.js b/web/modals/threads/settings/thread-settings-delete-confirmation-modal.react.js --- a/web/modals/threads/settings/thread-settings-delete-confirmation-modal.react.js +++ b/web/modals/threads/settings/thread-settings-delete-confirmation-modal.react.js @@ -5,14 +5,13 @@ import { useModalContext } from 'lib/components/modal-provider.react.js'; import { getThreadsToDeleteText } from 'lib/shared/thread-utils.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types'; import css from './thread-settings-delete-confirmation-modal.css'; import Button from '../../../components/button.react.js'; import Modal from '../../modal.react.js'; type BaseProps = { - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, +onConfirmation: () => mixed, }; diff --git a/web/modals/threads/settings/thread-settings-delete-tab.react.js b/web/modals/threads/settings/thread-settings-delete-tab.react.js --- a/web/modals/threads/settings/thread-settings-delete-tab.react.js +++ b/web/modals/threads/settings/thread-settings-delete-tab.react.js @@ -11,7 +11,6 @@ import { containedThreadInfos } from 'lib/selectors/thread-selectors.js'; import { type SetState } from 'lib/types/hook-types.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; import SubmitSection from './submit-section.react.js'; @@ -22,7 +21,7 @@ type ThreadSettingsDeleteTabProps = { +threadSettingsOperationInProgress: boolean, - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, +setErrorMessage: SetState, +errorMessage?: ?string, }; diff --git a/web/modals/threads/settings/thread-settings-general-tab.react.js b/web/modals/threads/settings/thread-settings-general-tab.react.js --- a/web/modals/threads/settings/thread-settings-general-tab.react.js +++ b/web/modals/threads/settings/thread-settings-general-tab.react.js @@ -11,10 +11,7 @@ import { type SetState } from 'lib/types/hook-types.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; -import { - type ThreadChanges, - type LegacyThreadInfo, -} from 'lib/types/thread-types.js'; +import { type ThreadChanges } from 'lib/types/thread-types.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; import { firstLine } from 'lib/utils/string-utils.js'; import { chatNameMaxLength } from 'lib/utils/validation-utils.js'; @@ -28,7 +25,7 @@ type ThreadSettingsGeneralTabProps = { +threadSettingsOperationInProgress: boolean, - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, +threadNamePlaceholder: string, +queuedChanges: ThreadChanges, +setQueuedChanges: SetState, diff --git a/web/modals/threads/settings/thread-settings-modal.react.js b/web/modals/threads/settings/thread-settings-modal.react.js --- a/web/modals/threads/settings/thread-settings-modal.react.js +++ b/web/modals/threads/settings/thread-settings-modal.react.js @@ -20,10 +20,7 @@ import type { RelationshipButton } from 'lib/types/relationship-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; -import { - type ThreadChanges, - type LegacyThreadInfo, -} from 'lib/types/thread-types.js'; +import { type ThreadChanges } from 'lib/types/thread-types.js'; import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js'; import ThreadSettingsDeleteTab from './thread-settings-delete-tab.react.js'; @@ -101,7 +98,7 @@ const hasPermissionForTab = React.useCallback( // ESLint doesn't recognize that invariant always throws // eslint-disable-next-line consistent-return - (thread: LegacyThreadInfo | ThreadInfo, tab: TabType) => { + (thread: ThreadInfo, tab: TabType) => { if (tab === 'general') { return ( threadHasPermission(thread, threadPermissions.EDIT_THREAD_NAME) || diff --git a/web/modals/threads/settings/thread-settings-privacy-tab.react.js b/web/modals/threads/settings/thread-settings-privacy-tab.react.js --- a/web/modals/threads/settings/thread-settings-privacy-tab.react.js +++ b/web/modals/threads/settings/thread-settings-privacy-tab.react.js @@ -12,10 +12,7 @@ import { type SetState } from 'lib/types/hook-types.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; -import { - type ThreadChanges, - type LegacyThreadInfo, -} from 'lib/types/thread-types.js'; +import { type ThreadChanges } from 'lib/types/thread-types.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; import SubmitSection from './submit-section.react.js'; @@ -42,7 +39,7 @@ type ThreadSettingsPrivacyTabProps = { +threadSettingsOperationInProgress: boolean, - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, +queuedChanges: ThreadChanges, +setQueuedChanges: SetState, +setErrorMessage: SetState, diff --git a/web/modals/user-profile/user-profile-action-buttons.react.js b/web/modals/user-profile/user-profile-action-buttons.react.js --- a/web/modals/user-profile/user-profile-action-buttons.react.js +++ b/web/modals/user-profile/user-profile-action-buttons.react.js @@ -6,7 +6,6 @@ import { useRelationshipPrompt } from 'lib/hooks/relationship-prompt.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { userRelationshipStatus } from 'lib/types/relationship-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types'; import UserProfileMessageButton from './user-profile-message-button.react.js'; import css from './user-profile.css'; @@ -14,7 +13,7 @@ import { buttonThemes } from '../../components/button.react.js'; type Props = { - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, }; function UserProfileActionButtons(props: Props): React.Node { diff --git a/web/modals/user-profile/user-profile-menu.react.js b/web/modals/user-profile/user-profile-menu.react.js --- a/web/modals/user-profile/user-profile-menu.react.js +++ b/web/modals/user-profile/user-profile-menu.react.js @@ -8,7 +8,6 @@ import { useRelationshipPrompt } from 'lib/hooks/relationship-prompt.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { userRelationshipStatus } from 'lib/types/relationship-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types'; import MenuItem from '../../components/menu-item.react.js'; import Menu from '../../components/menu.react.js'; @@ -22,7 +21,7 @@ const unblockIcon = ; type Props = { - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, }; function UserProfileMenu(props: Props): React.Node { diff --git a/web/modals/user-profile/user-profile-message-button.react.js b/web/modals/user-profile/user-profile-message-button.react.js --- a/web/modals/user-profile/user-profile-message-button.react.js +++ b/web/modals/user-profile/user-profile-message-button.react.js @@ -5,14 +5,13 @@ import { useModalContext } from 'lib/components/modal-provider.react.js'; import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import css from './user-profile.css'; import Button from '../../components/button.react.js'; import { useOnClickThread } from '../../selectors/thread-selectors.js'; type Props = { - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, }; function UserProfileMessageButton(props: Props): React.Node { diff --git a/web/roles/community-roles-modal.react.js b/web/roles/community-roles-modal.react.js --- a/web/roles/community-roles-modal.react.js +++ b/web/roles/community-roles-modal.react.js @@ -7,7 +7,6 @@ import { useRoleMemberCountsForCommunity } from 'lib/shared/thread-utils.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { UserSurfacedPermission } from 'lib/types/thread-permission-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import css from './community-roles-modal.css'; import CreateRolesModal from './create-roles-modal.react.js'; @@ -17,18 +16,16 @@ import { useSelector } from '../redux/redux-utils.js'; type CommunityRolesModalProps = { - +community: LegacyThreadInfo | ThreadInfo, + +community: ThreadInfo, }; function CommunityRolesModal(props: CommunityRolesModalProps): React.Node { const { popModal, pushModal } = useModalContext(); const { community } = props; - const [threadInfo, setThreadInfo] = React.useState< - LegacyThreadInfo | ThreadInfo, - >(community); + const [threadInfo, setThreadInfo] = React.useState(community); const threadID = threadInfo.id; - const reduxThreadInfo: ?LegacyThreadInfo | ?ThreadInfo = useSelector( + const reduxThreadInfo: ?ThreadInfo = useSelector( state => threadInfoSelector(state)[threadID], ); diff --git a/web/roles/create-roles-modal.react.js b/web/roles/create-roles-modal.react.js --- a/web/roles/create-roles-modal.react.js +++ b/web/roles/create-roles-modal.react.js @@ -17,10 +17,7 @@ type UserSurfacedPermissionOption, userSurfacedPermissionOptions, } from 'lib/types/thread-permission-types.js'; -import type { - LegacyThreadInfo, - RoleModificationRequest, -} from 'lib/types/thread-types.js'; +import type { RoleModificationRequest } from 'lib/types/thread-types.js'; import { values } from 'lib/utils/objects.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; @@ -38,7 +35,7 @@ ); type CreateRolesModalProps = { - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, +action: 'create_role' | 'edit_role', +existingRoleID?: string, +roleName: string, diff --git a/web/roles/delete-role-modal.react.js b/web/roles/delete-role-modal.react.js --- a/web/roles/delete-role-modal.react.js +++ b/web/roles/delete-role-modal.react.js @@ -11,7 +11,6 @@ import { useRoleMemberCountsForCommunity } from 'lib/shared/thread-utils.js'; import type { LoadingStatus } from 'lib/types/loading-types.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; import { constructRoleDeletionMessagePrompt } from 'lib/utils/role-utils.js'; @@ -25,7 +24,7 @@ ); type DeleteRoleModalProps = { - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, +defaultRoleID: string, +roleID: string, }; diff --git a/web/roles/role-actions-menu.react.js b/web/roles/role-actions-menu.react.js --- a/web/roles/role-actions-menu.react.js +++ b/web/roles/role-actions-menu.react.js @@ -7,7 +7,6 @@ import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; import { useRoleUserSurfacedPermissions } from 'lib/shared/thread-utils.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useRoleDeletableAndEditableStatus } from 'lib/utils/role-utils.js'; import CreateRolesModal from './create-roles-modal.react.js'; @@ -19,7 +18,7 @@ const menuIcon = ; type RoleActionsMenuProps = { - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, +roleName: string, }; diff --git a/web/roles/role-panel-entry.react.js b/web/roles/role-panel-entry.react.js --- a/web/roles/role-panel-entry.react.js +++ b/web/roles/role-panel-entry.react.js @@ -3,14 +3,13 @@ import * as React from 'react'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import RoleActionsMenu from './role-actions-menu.react.js'; import css from './role-panel-entry.css'; import CommIcon from '../CommIcon.react.js'; type RolePanelEntryProps = { - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, +roleName: string, +memberCount: number, }; diff --git a/web/selectors/calendar-selectors.js b/web/selectors/calendar-selectors.js --- a/web/selectors/calendar-selectors.js +++ b/web/selectors/calendar-selectors.js @@ -10,7 +10,6 @@ import type SearchIndex from 'lib/shared/search-index.js'; import type { FilterThreadInfo } from 'lib/types/filter-types.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { filterThreadIDsBelongingToCommunity } from 'lib/utils/drawer-utils.react.js'; import type { AppState } from '../redux/redux-setup.js'; @@ -34,7 +33,7 @@ ( calendarPickedCommunityID: ?string, threadInfos: { - +[id: string]: LegacyThreadInfo | ThreadInfo, + +[id: string]: ThreadInfo, }, ) => { if (!calendarPickedCommunityID) { diff --git a/web/selectors/thread-selectors.js b/web/selectors/thread-selectors.js --- a/web/selectors/thread-selectors.js +++ b/web/selectors/thread-selectors.js @@ -16,10 +16,7 @@ RobotextMessageInfo, } from 'lib/types/message-types.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { - LegacyThreadInfo, - RawThreadInfos, -} from 'lib/types/thread-types.js'; +import type { RawThreadInfos } from 'lib/types/thread-types.js'; import { values } from 'lib/utils/objects.js'; import { useDispatch } from 'lib/utils/redux-utils.js'; @@ -29,7 +26,7 @@ import { useSelector } from '../redux/redux-utils.js'; function useOnClickThread( - thread: ?LegacyThreadInfo | ?ThreadInfo, + thread: ?ThreadInfo, ): (event: SyntheticEvent) => void { const dispatch = useDispatch(); return React.useCallback( @@ -69,7 +66,7 @@ function useOnClickPendingSidebar( messageInfo: ComposableMessageInfo | RobotextMessageInfo, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, ): (event: SyntheticEvent) => mixed { const dispatch = useDispatch(); const loggedInUserInfo = useLoggedInUserInfo(); diff --git a/web/sidebar/community-drawer-item-community-handlers.react.js b/web/sidebar/community-drawer-item-community-handlers.react.js --- a/web/sidebar/community-drawer-item-community-handlers.react.js +++ b/web/sidebar/community-drawer-item-community-handlers.react.js @@ -8,7 +8,6 @@ updateChatCommunityFilter, } from 'lib/actions/community-actions.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useDispatch } from 'lib/utils/redux-utils.js'; import type { CommunityDrawerItemCommunityHandler } from './community-drawer-item-handler.react.js'; @@ -22,7 +21,7 @@ export type HandlerProps = { +setHandler: (handler: CommunityDrawerItemCommunityHandler) => void, - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, }; function ChatDrawerItemCommunityHandler(props: HandlerProps): React.Node { diff --git a/web/sidebar/community-drawer-item-handlers.react.js b/web/sidebar/community-drawer-item-handlers.react.js --- a/web/sidebar/community-drawer-item-handlers.react.js +++ b/web/sidebar/community-drawer-item-handlers.react.js @@ -3,7 +3,6 @@ import * as React from 'react'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import type { CommunityDrawerItemHandler } from './community-drawer-item-handler.react.js'; import { useCommunityIsPickedCalendar } from '../selectors/calendar-selectors.js'; @@ -15,7 +14,7 @@ export type HandlerProps = { +setHandler: (handler: CommunityDrawerItemHandler) => void, - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, }; function ChatDrawerItemHandler(props: HandlerProps): React.Node { diff --git a/web/sidebar/community-drawer-utils.react.js b/web/sidebar/community-drawer-utils.react.js --- a/web/sidebar/community-drawer-utils.react.js +++ b/web/sidebar/community-drawer-utils.react.js @@ -3,7 +3,6 @@ import * as React from 'react'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types'; import type { CommunityDrawerItemData } from 'lib/utils/drawer-utils.react'; import css from './community-drawer-item.css'; @@ -28,7 +27,7 @@ hasSubchannelsButton: boolean, itemChildren: $ReadOnlyArray>, paddingLeft: number, - threadInfo: LegacyThreadInfo | ThreadInfo, + threadInfo: ThreadInfo, expandable: boolean, handlerType: NavigationTab, }): React.Node { diff --git a/web/sidebar/subchannels-button.react.js b/web/sidebar/subchannels-button.react.js --- a/web/sidebar/subchannels-button.react.js +++ b/web/sidebar/subchannels-button.react.js @@ -5,14 +5,13 @@ import { useModalContext } from 'lib/components/modal-provider.react.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import css from './subchannels-button.css'; import Button from '../components/button.react.js'; import SubchannelsModal from '../modals/threads/subchannels/subchannels-modal.react.js'; type Props = { - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, }; function SubchannelsButton(props: Props): React.Node { diff --git a/web/tooltips/message-tooltip.react.js b/web/tooltips/message-tooltip.react.js --- a/web/tooltips/message-tooltip.react.js +++ b/web/tooltips/message-tooltip.react.js @@ -8,7 +8,6 @@ import type { ChatMessageInfoItem } from 'lib/selectors/chat-selectors.js'; import { useNextLocalID } from 'lib/shared/message-utils.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import css from './message-tooltip.css'; import { @@ -33,7 +32,7 @@ +tooltipPositionStyle: TooltipPositionStyle, +tooltipSize: TooltipSize, +item: ChatMessageInfoItem, - +threadInfo: LegacyThreadInfo | ThreadInfo, + +threadInfo: ThreadInfo, }; function MessageTooltip(props: MessageTooltipProps): React.Node { const {