diff --git a/lib/shared/markdown.js b/lib/shared/markdown.js --- a/lib/shared/markdown.js +++ b/lib/shared/markdown.js @@ -6,6 +6,7 @@ markdownUserMentionRegex, decodeChatMentionText, } from './mention-utils.js'; +import type { MinimallyEncodedRelativeMemberInfo } from '../types/minimally-encoded-thread-permissions-types.js'; import type { RelativeMemberInfo, ResolvedThreadInfo, @@ -198,7 +199,9 @@ } function createMemberMapForUserMentions( - members: $ReadOnlyArray, + members: $ReadOnlyArray< + RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + >, ): $ReadOnlyMap { const membersMap = new Map(); members.forEach(member => { 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 @@ -6,6 +6,10 @@ import { EditThreadAvatarContext } from 'lib/components/base-edit-thread-avatar-provider.react.js'; import { useModalContext } from 'lib/components/modal-provider.react.js'; import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; +import type { + MinimallyEncodedRawThreadInfo, + MinimallyEncodedThreadInfo, +} from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { RawThreadInfo, ThreadInfo } from 'lib/types/thread-types.js'; import { useUploadAvatarMedia } from './avatar-hooks.react.js'; @@ -22,7 +26,11 @@ ); type Props = { - +threadInfo: RawThreadInfo | ThreadInfo, + +threadInfo: + | RawThreadInfo + | ThreadInfo + | MinimallyEncodedThreadInfo + | MinimallyEncodedRawThreadInfo, }; 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 @@ -5,6 +5,10 @@ import { EditThreadAvatarContext } from 'lib/components/base-edit-thread-avatar-provider.react.js'; import { threadHasPermission } from 'lib/shared/thread-utils.js'; +import type { + MinimallyEncodedRawThreadInfo, + MinimallyEncodedThreadInfo, +} from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; import type { RawThreadInfo, ThreadInfo } from 'lib/types/thread-types.js'; @@ -13,7 +17,11 @@ import ThreadAvatar from './thread-avatar.react.js'; type Props = { - +threadInfo: RawThreadInfo | ThreadInfo, + +threadInfo: + | RawThreadInfo + | ThreadInfo + | MinimallyEncodedRawThreadInfo + | MinimallyEncodedThreadInfo, +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 @@ -8,6 +8,10 @@ } from 'lib/shared/avatar-utils.js'; import { getSingleOtherUser } from 'lib/shared/thread-utils.js'; import type { AvatarSize } from 'lib/types/avatar-types.js'; +import type { + MinimallyEncodedRawThreadInfo, + MinimallyEncodedThreadInfo, +} from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; import { type RawThreadInfo, type ThreadInfo } from 'lib/types/thread-types.js'; @@ -15,7 +19,11 @@ import { useSelector } from '../redux/redux-utils.js'; type Props = { - +threadInfo: RawThreadInfo | ThreadInfo, + +threadInfo: + | RawThreadInfo + | ThreadInfo + | MinimallyEncodedRawThreadInfo + | MinimallyEncodedThreadInfo, +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 @@ -12,12 +12,20 @@ ClientAvatar, ClientEmojiAvatar, } from 'lib/types/avatar-types.js'; +import type { + MinimallyEncodedRawThreadInfo, + MinimallyEncodedThreadInfo, +} from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { RawThreadInfo, ThreadInfo } from 'lib/types/thread-types.js'; import EmojiAvatarSelectionModal from './emoji-avatar-selection-modal.react.js'; type Props = { - +threadInfo: ThreadInfo | RawThreadInfo, + +threadInfo: + | ThreadInfo + | RawThreadInfo + | MinimallyEncodedThreadInfo + | MinimallyEncodedRawThreadInfo, }; 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 @@ -17,6 +17,7 @@ import { onScreenThreadInfos as onScreenThreadInfosSelector } from 'lib/selectors/thread-selectors.js'; import { entryKey } from 'lib/shared/entry-utils.js'; import type { EntryInfo } from 'lib/types/entry-types.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { Dispatch } from 'lib/types/redux-types.js'; import type { ThreadInfo } from 'lib/types/thread-types.js'; import { dateString, dateFromString } from 'lib/utils/date-utils.js'; @@ -38,7 +39,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 @@ -5,6 +5,7 @@ import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; import useToggleUnreadStatus from 'lib/hooks/toggle-unread-status.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ThreadInfo } from 'lib/types/thread-types.js'; import css from './chat-thread-list-item-menu.css'; @@ -12,7 +13,7 @@ import { useThreadIsActive } from '../selectors/thread-selectors.js'; type Props = { - +threadInfo: ThreadInfo, + +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, +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 @@ -5,13 +5,14 @@ import { IoIosMore } from 'react-icons/io/index.js'; import { useModalContext } from 'lib/components/modal-provider.react.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ThreadInfo } 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: ThreadInfo, + +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, +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 @@ -7,6 +7,7 @@ import type { ReactionInfo } from 'lib/selectors/chat-selectors.js'; import { getInlineEngagementSidebarText } from 'lib/shared/inline-engagement-utils.js'; import type { MessageInfo } from 'lib/types/message-types.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ThreadInfo } from 'lib/types/thread-types.js'; import css from './inline-engagement.css'; @@ -16,7 +17,7 @@ type Props = { +messageInfo: MessageInfo, - +threadInfo: ThreadInfo, + +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, +sidebarThreadInfo: ?ThreadInfo, +reactions: ReactionInfo, +positioning: 'left' | 'center' | 'right', diff --git a/web/chat/message-tooltip.react.js b/web/chat/message-tooltip.react.js --- a/web/chat/message-tooltip.react.js +++ b/web/chat/message-tooltip.react.js @@ -7,6 +7,7 @@ import type { ChatMessageInfoItem } from 'lib/selectors/chat-selectors.js'; import { useNextLocalID } from 'lib/shared/message-utils.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ThreadInfo } from 'lib/types/thread-types.js'; import { @@ -32,7 +33,7 @@ +tooltipPositionStyle: TooltipPositionStyle, +tooltipSize: TooltipSize, +item: ChatMessageInfoItem, - +threadInfo: ThreadInfo, + +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, }; function MessageTooltip(props: MessageTooltipProps): React.Node { const { 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 @@ -9,6 +9,7 @@ import * as React from 'react'; import { useRelationshipPrompt } from 'lib/hooks/relationship-prompt.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { userRelationshipStatus } from 'lib/types/relationship-types.js'; import type { ThreadInfo } from 'lib/types/thread-types.js'; @@ -16,7 +17,7 @@ import RelationshipPromptButton from './relationship-prompt-button.js'; import { buttonThemes } from '../../components/button.react.js'; -type Props = { +threadInfo: ThreadInfo }; +type Props = { +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo }; 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 @@ -6,6 +6,7 @@ import { type RobotextChatMessageInfoItem } from 'lib/selectors/chat-selectors.js'; import { threadInfoSelector } from 'lib/selectors/thread-selectors.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { Dispatch } from 'lib/types/redux-types.js'; import { type ThreadInfo } from 'lib/types/thread-types.js'; import { @@ -104,7 +105,7 @@ }; type InnerThreadEntityProps = { ...BaseInnerThreadEntityProps, - +threadInfo: ThreadInfo, + +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, +dispatch: Dispatch, }; class InnerThreadEntity extends React.PureComponent { 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 @@ -11,6 +11,7 @@ inviteLinkErrorMessages, } from 'lib/shared/invite-links.js'; import type { InviteLink } from 'lib/types/link-types.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ThreadInfo } from 'lib/types/thread-types.js'; import css from './manage-invite-links-modal.css'; @@ -22,7 +23,7 @@ +inviteLink: ?InviteLink, +enterViewMode: () => mixed, +enterDisableMode: () => mixed, - +community: ThreadInfo, + +community: ThreadInfo | MinimallyEncodedThreadInfo, }; 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 @@ -6,6 +6,10 @@ import * as SharedMarkdown from 'lib/shared/markdown.js'; import { chatMentionRegex } from 'lib/shared/mention-utils.js'; +import type { + MinimallyEncodedRelativeMemberInfo, + MinimallyEncodedThreadInfo, +} from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { RelativeMemberInfo, ThreadInfo, @@ -165,7 +169,7 @@ }); function useTextMessageRulesFunc( - threadInfo: ThreadInfo, + threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, chatMentionCandidates: ChatMentionCandidates, ): boolean => MarkdownRules { const { members } = threadInfo; @@ -179,7 +183,9 @@ } function textMessageRules( - members: $ReadOnlyArray, + members: $ReadOnlyArray< + RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + >, chatMentionCandidates: ChatMentionCandidates, useDarkStyle: boolean, ): MarkdownRules { 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 @@ -10,12 +10,13 @@ } from 'lib/shared/message-utils.js'; import { filterChatMessageInfosForSearch } from 'lib/shared/search-utils.js'; import type { RawMessageInfo } from 'lib/types/message-types.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ThreadInfo } from 'lib/types/thread-types.js'; import { useSelector } from '../../redux/redux-utils.js'; function useParseSearchResults( - threadInfo: ThreadInfo, + threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, searchResults: $ReadOnlyArray, ): $ReadOnlyArray { const userInfos = useSelector(state => state.userStore.userInfos); 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 @@ -9,6 +9,7 @@ encryptedVideoThumbnailBlobURI, } from 'lib/media/media-utils.js'; import type { Media } from 'lib/types/media-types.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ThreadInfo } from 'lib/types/thread-types.js'; import GalleryItem from './thread-settings-media-gallery-item.react.js'; @@ -21,7 +22,7 @@ type ThreadSettingsMediaGalleryModalProps = { +onClose: () => void, - +parentThreadInfo: ThreadInfo, + +parentThreadInfo: ThreadInfo | MinimallyEncodedThreadInfo, +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 @@ -11,6 +11,7 @@ import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; import { otherUsersButNoOtherAdmins } from 'lib/selectors/thread-selectors.js'; import { roleIsAdminRole } from 'lib/shared/thread-utils.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { RelativeMemberInfo, ThreadInfo } from 'lib/types/thread-types'; import { useDispatchActionPromise } from 'lib/utils/action-utils.js'; import { values } from 'lib/utils/objects.js'; @@ -25,7 +26,7 @@ type ChangeMemberRoleModalProps = { +memberInfo: RelativeMemberInfo, - +threadInfo: ThreadInfo, + +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, }; 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 @@ -11,6 +11,7 @@ } from 'lib/shared/thread-utils.js'; import { stringForUser } from 'lib/shared/user-utils.js'; import type { SetState } from 'lib/types/hook-types.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { type RelativeMemberInfo, type ThreadInfo, @@ -31,7 +32,7 @@ type Props = { +memberInfo: RelativeMemberInfo, - +threadInfo: ThreadInfo, + +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, +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 @@ -7,6 +7,7 @@ import { useENSNames } from 'lib/hooks/ens-cache.js'; import { stringForUser } from 'lib/shared/user-utils.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { type ThreadInfo, type RelativeMemberInfo, @@ -16,7 +17,7 @@ import css from './members-modal.css'; type Props = { - +threadInfo: ThreadInfo, + +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, +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 @@ -4,6 +4,7 @@ import { useModalContext } from 'lib/components/modal-provider.react.js'; import { getThreadsToDeleteText } from 'lib/shared/thread-utils.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ThreadInfo } from 'lib/types/thread-types'; import css from './thread-settings-delete-confirmation-modal.css'; @@ -11,7 +12,7 @@ import Modal from '../../modal.react.js'; type BaseProps = { - +threadInfo: ThreadInfo, + +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, +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 @@ -10,6 +10,7 @@ import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; import { containedThreadInfos } from 'lib/selectors/thread-selectors.js'; import { type SetState } from 'lib/types/hook-types.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { type ThreadInfo } from 'lib/types/thread-types.js'; import { useDispatchActionPromise } from 'lib/utils/action-utils.js'; @@ -21,7 +22,7 @@ type ThreadSettingsDeleteTabProps = { +threadSettingsOperationInProgress: boolean, - +threadInfo: ThreadInfo, + +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, +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 @@ -9,6 +9,7 @@ } from 'lib/actions/thread-actions.js'; import { threadHasPermission } from 'lib/shared/thread-utils.js'; import { type SetState } from 'lib/types/hook-types.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; import { type ThreadInfo, type ThreadChanges } from 'lib/types/thread-types.js'; import { useDispatchActionPromise } from 'lib/utils/action-utils.js'; @@ -24,7 +25,7 @@ type ThreadSettingsGeneralTabProps = { +threadSettingsOperationInProgress: boolean, - +threadInfo: ThreadInfo, + +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, +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 @@ -16,6 +16,7 @@ getSingleOtherUser, threadUIName, } from 'lib/shared/thread-utils.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; import { type ThreadInfo, type ThreadChanges } from 'lib/types/thread-types.js'; @@ -96,7 +97,7 @@ const hasPermissionForTab = React.useCallback( // ESLint doesn't recognize that invariant always throws // eslint-disable-next-line consistent-return - (thread: ThreadInfo, tab: TabType) => { + (thread: ThreadInfo | MinimallyEncodedThreadInfo, 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 @@ -10,6 +10,7 @@ import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; import { threadTypeDescriptions } from 'lib/shared/thread-utils.js'; import { type SetState } from 'lib/types/hook-types.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; import { type ThreadInfo, type ThreadChanges } from 'lib/types/thread-types.js'; import { useDispatchActionPromise } from 'lib/utils/action-utils.js'; @@ -38,7 +39,7 @@ type ThreadSettingsPrivacyTabProps = { +threadSettingsOperationInProgress: boolean, - +threadInfo: ThreadInfo, + +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, +queuedChanges: ThreadChanges, +setQueuedChanges: SetState, +setErrorMessage: SetState, 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 @@ -6,6 +6,7 @@ import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; import { useRelationshipPrompt } from 'lib/hooks/relationship-prompt.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { userRelationshipStatus } from 'lib/types/relationship-types.js'; import type { ThreadInfo } from 'lib/types/thread-types'; @@ -21,7 +22,7 @@ const unblockIcon = ; type Props = { - +threadInfo: ThreadInfo, + +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, }; 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 @@ -4,6 +4,7 @@ import { useModalContext } from 'lib/components/modal-provider.react.js'; import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ThreadInfo } from 'lib/types/thread-types.js'; import css from './user-profile.css'; @@ -11,7 +12,7 @@ import { useOnClickThread } from '../../selectors/thread-selectors.js'; type Props = { - +threadInfo: ThreadInfo, + +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, }; function UserProfileMessageButton(props: Props): React.Node { 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,6 +16,7 @@ ComposableMessageInfo, RobotextMessageInfo, } from 'lib/types/message-types.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ThreadInfo, RawThreadInfos } from 'lib/types/thread-types.js'; import { values } from 'lib/utils/objects.js'; @@ -25,7 +26,7 @@ import { useSelector } from '../redux/redux-utils.js'; function useOnClickThread( - thread: ?ThreadInfo, + thread: ?ThreadInfo | ?MinimallyEncodedThreadInfo, ): (event: SyntheticEvent) => void { const dispatch = useDispatch(); return React.useCallback( 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,6 +8,7 @@ updateChatCommunityFilter, clearChatCommunityFilter, } from 'lib/actions/community-actions.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ThreadInfo } from 'lib/types/thread-types.js'; import type { CommunityDrawerItemCommunityHandler } from './community-drawer-item-handler.react.js'; @@ -21,7 +22,7 @@ export type HandlerProps = { +setHandler: (handler: CommunityDrawerItemCommunityHandler) => void, - +threadInfo: ThreadInfo, + +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, }; 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 @@ -2,6 +2,7 @@ import * as React from 'react'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ThreadInfo } from 'lib/types/thread-types.js'; import type { CommunityDrawerItemHandler } from './community-drawer-item-handler.react.js'; @@ -14,7 +15,7 @@ export type HandlerProps = { +setHandler: (handler: CommunityDrawerItemHandler) => void, - +threadInfo: ThreadInfo, + +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, }; 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 @@ -2,6 +2,7 @@ import * as React from 'react'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ThreadInfo } from 'lib/types/thread-types'; import type { CommunityDrawerItemData } from 'lib/utils/drawer-utils.react'; @@ -27,7 +28,7 @@ hasSubchannelsButton: boolean, itemChildren: $ReadOnlyArray>, paddingLeft: number, - threadInfo: ThreadInfo, + threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, 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 @@ -4,6 +4,7 @@ import { CornerDownRight } from 'react-feather'; import { useModalContext } from 'lib/components/modal-provider.react.js'; +import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ThreadInfo } from 'lib/types/thread-types.js'; import css from './subchannels-button.css'; @@ -11,7 +12,7 @@ import SubchannelsModal from '../modals/threads/subchannels/subchannels-modal.react.js'; type Props = { - +threadInfo: ThreadInfo, + +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, }; function SubchannelsButton(props: Props): React.Node {