Introduce Service Id Types
Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
parent
414c0a58d3
commit
366b875fd2
269 changed files with 5832 additions and 5550 deletions
|
@ -18,6 +18,7 @@ import {
|
|||
import type { ConversationTypeType } from '../state/ducks/conversations';
|
||||
import type { AvatarColorType } from '../types/Colors';
|
||||
import { AvatarColors } from '../types/Colors';
|
||||
import { generateAci } from '../types/ServiceId';
|
||||
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
|
||||
import { fakeGetGroupCallVideoFrameSource } from '../test-both/helpers/fakeGetGroupCallVideoFrameSource';
|
||||
import { setupI18n } from '../util/setupI18n';
|
||||
|
@ -89,7 +90,7 @@ const createProps = (storyProps: Partial<PropsType> = {}): PropsType => ({
|
|||
),
|
||||
title: text('Caller Title', 'Morty Smith'),
|
||||
}),
|
||||
uuid: 'cb0dd0c8-7393-41e9-a0aa-d631c4109541',
|
||||
uuid: generateAci(),
|
||||
},
|
||||
notifyForCall: action('notify-for-call'),
|
||||
openSystemPreferencesAction: action('open-system-preferences-action'),
|
||||
|
|
|
@ -14,6 +14,7 @@ import {
|
|||
GroupCallConnectionState,
|
||||
GroupCallJoinState,
|
||||
} from '../types/Calling';
|
||||
import { generateAci } from '../types/ServiceId';
|
||||
import type { ConversationType } from '../state/ducks/conversations';
|
||||
import { AvatarColors } from '../types/Colors';
|
||||
import type { PropsType } from './CallScreen';
|
||||
|
@ -174,7 +175,7 @@ const createProps = (
|
|||
name: 'Morty Smith',
|
||||
profileName: 'Morty Smith',
|
||||
title: 'Morty Smith',
|
||||
uuid: '3c134598-eecb-42ab-9ad3-2b0873f771b2',
|
||||
uuid: generateAci(),
|
||||
}),
|
||||
openSystemPreferencesAction: action('open-system-preferences-action'),
|
||||
setGroupCallVideoRequest: action('set-group-call-video-request'),
|
||||
|
@ -311,7 +312,7 @@ export function GroupCall1(): JSX.Element {
|
|||
videoAspectRatio: 1.3,
|
||||
...getDefaultConversation({
|
||||
isBlocked: false,
|
||||
uuid: '72fa60e5-25fb-472d-8a56-e56867c57dda',
|
||||
uuid: generateAci(),
|
||||
title: 'Tyler',
|
||||
}),
|
||||
},
|
||||
|
@ -379,7 +380,7 @@ export function GroupCallReconnecting(): JSX.Element {
|
|||
...getDefaultConversation({
|
||||
isBlocked: false,
|
||||
title: 'Tyler',
|
||||
uuid: '33871c64-0c22-45ce-8aa4-0ec237ac4a31',
|
||||
uuid: generateAci(),
|
||||
}),
|
||||
},
|
||||
],
|
||||
|
|
|
@ -5,13 +5,14 @@ import * as React from 'react';
|
|||
import { times } from 'lodash';
|
||||
import { boolean } from '@storybook/addon-knobs';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { v4 as generateUuid } from 'uuid';
|
||||
|
||||
import { AvatarColors } from '../types/Colors';
|
||||
import type { ConversationType } from '../state/ducks/conversations';
|
||||
import type { PropsType } from './CallingLobby';
|
||||
import { CallingLobby } from './CallingLobby';
|
||||
import { setupI18n } from '../util/setupI18n';
|
||||
import { UUID } from '../types/UUID';
|
||||
import { generateAci } from '../types/ServiceId';
|
||||
import enMessages from '../../_locales/en/messages.json';
|
||||
import {
|
||||
getDefaultConversation,
|
||||
|
@ -65,8 +66,8 @@ const createProps = (overrideProps: Partial<PropsType> = {}): PropsType => {
|
|||
overrideProps.me ||
|
||||
getDefaultConversation({
|
||||
color: AvatarColors[0],
|
||||
id: UUID.generate().toString(),
|
||||
uuid: UUID.generate().toString(),
|
||||
id: generateUuid(),
|
||||
uuid: generateAci(),
|
||||
}),
|
||||
onCallCanceled: action('on-call-canceled'),
|
||||
onJoinCall: action('on-join-call'),
|
||||
|
@ -116,8 +117,8 @@ export function NoCameraLocalAvatar(): JSX.Element {
|
|||
me: getDefaultConversation({
|
||||
avatarPath: '/fixtures/kitten-4-112-112.jpg',
|
||||
color: AvatarColors[0],
|
||||
id: UUID.generate().toString(),
|
||||
uuid: UUID.generate().toString(),
|
||||
id: generateUuid(),
|
||||
uuid: generateAci(),
|
||||
}),
|
||||
});
|
||||
return <CallingLobby {...props} />;
|
||||
|
@ -167,11 +168,11 @@ GroupCall1PeekedParticipant.story = {
|
|||
};
|
||||
|
||||
export function GroupCall1PeekedParticipantSelf(): JSX.Element {
|
||||
const uuid = UUID.generate().toString();
|
||||
const uuid = generateAci();
|
||||
const props = createProps({
|
||||
isGroupCall: true,
|
||||
me: getDefaultConversation({
|
||||
id: UUID.generate().toString(),
|
||||
id: generateUuid(),
|
||||
uuid,
|
||||
}),
|
||||
peekedParticipants: [fakePeekedParticipant({ title: 'Ash', uuid })],
|
||||
|
|
|
@ -11,6 +11,7 @@ import { getDefaultConversation } from '../test-both/helpers/getDefaultConversat
|
|||
import type { Props } from './CompositionInput';
|
||||
import { CompositionInput } from './CompositionInput';
|
||||
import { setupI18n } from '../util/setupI18n';
|
||||
import { generateAci } from '../types/ServiceId';
|
||||
import enMessages from '../../_locales/en/messages.json';
|
||||
import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext';
|
||||
|
||||
|
@ -137,7 +138,7 @@ export function Mentions(): JSX.Element {
|
|||
{
|
||||
start: 5,
|
||||
length: 1,
|
||||
mentionUuid: '0',
|
||||
mentionUuid: generateAci(),
|
||||
conversationID: 'k',
|
||||
replacementText: 'Kate Beaton',
|
||||
},
|
||||
|
|
|
@ -26,7 +26,7 @@ import { BodyRange, collapseRangeTree, insertRange } from '../types/BodyRange';
|
|||
import type { LocalizerType, ThemeType } from '../types/Util';
|
||||
import type { ConversationType } from '../state/ducks/conversations';
|
||||
import type { PreferredBadgeSelectorType } from '../state/selectors/badges';
|
||||
import { isValidUuid } from '../types/UUID';
|
||||
import { isServiceIdString } from '../types/ServiceId';
|
||||
import { MentionBlot } from '../quill/mentions/blot';
|
||||
import {
|
||||
matchEmojiImage,
|
||||
|
@ -46,6 +46,7 @@ import {
|
|||
import { SignalClipboard } from '../quill/signal-clipboard';
|
||||
import { DirectionalBlot } from '../quill/block/blot';
|
||||
import { getClassNamesFor } from '../util/getClassNamesFor';
|
||||
import { isNotNil } from '../util/isNotNil';
|
||||
import * as log from '../logging/log';
|
||||
import * as Errors from '../types/errors';
|
||||
import { useRefMerger } from '../hooks/useRefMerger';
|
||||
|
@ -677,11 +678,15 @@ export function CompositionInput(props: Props): React.ReactElement {
|
|||
return;
|
||||
}
|
||||
|
||||
const currentMemberUuids = currentMembers
|
||||
const currentMemberServiceIds = currentMembers
|
||||
.map(m => m.uuid)
|
||||
.filter(isValidUuid);
|
||||
.filter(isNotNil)
|
||||
.filter(isServiceIdString);
|
||||
|
||||
const newDelta = getDeltaToRemoveStaleMentions(ops, currentMemberUuids);
|
||||
const newDelta = getDeltaToRemoveStaleMentions(
|
||||
ops,
|
||||
currentMemberServiceIds
|
||||
);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
quill.updateContents(newDelta as any);
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
import React, { useContext } from 'react';
|
||||
import { times, omit } from 'lodash';
|
||||
import { v4 as generateUuid } from 'uuid';
|
||||
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { boolean, date, select, text } from '@storybook/addon-knobs';
|
||||
|
@ -18,8 +19,7 @@ import { setupI18n } from '../util/setupI18n';
|
|||
import enMessages from '../../_locales/en/messages.json';
|
||||
import { ThemeType } from '../types/Util';
|
||||
import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext';
|
||||
import { UUID } from '../types/UUID';
|
||||
import { makeFakeLookupConversationWithoutUuid } from '../test-both/helpers/fakeLookupConversationWithoutUuid';
|
||||
import { makeFakeLookupConversationWithoutServiceId } from '../test-both/helpers/fakeLookupConversationWithoutServiceId';
|
||||
|
||||
const i18n = setupI18n('en', enMessages);
|
||||
|
||||
|
@ -95,7 +95,7 @@ function Wrapper({
|
|||
/>
|
||||
)}
|
||||
scrollable={scrollable}
|
||||
lookupConversationWithoutUuid={makeFakeLookupConversationWithoutUuid()}
|
||||
lookupConversationWithoutServiceId={makeFakeLookupConversationWithoutServiceId()}
|
||||
showChooseGroupMembers={action('showChooseGroupMembers')}
|
||||
showUserNotFoundModal={action('showUserNotFoundModal')}
|
||||
setIsFetchingUUID={action('setIsFetchingUUID')}
|
||||
|
@ -381,7 +381,7 @@ ConversationsMessageStatuses.story = {
|
|||
|
||||
export const ConversationTypingStatus = (): JSX.Element =>
|
||||
renderConversation({
|
||||
typingContactId: UUID.generate().toString(),
|
||||
typingContactId: generateUuid(),
|
||||
});
|
||||
|
||||
ConversationTypingStatus.story = {
|
||||
|
|
|
@ -14,7 +14,7 @@ import type { LocalizerType, ThemeType } from '../types/Util';
|
|||
import { ScrollBehavior } from '../types/Util';
|
||||
import { getNavSidebarWidthBreakpoint } from './_util';
|
||||
import type { PreferredBadgeSelectorType } from '../state/selectors/badges';
|
||||
import type { LookupConversationWithoutUuidActionsType } from '../util/lookupConversationWithoutUuid';
|
||||
import type { LookupConversationWithoutServiceIdActionsType } from '../util/lookupConversationWithoutServiceId';
|
||||
import type { ShowConversationType } from '../state/ducks/conversations';
|
||||
|
||||
import type { PropsData as ConversationListItemPropsType } from './conversationList/ConversationListItem';
|
||||
|
@ -189,7 +189,7 @@ export type PropsType = {
|
|||
renderMessageSearchResult?: (id: string) => JSX.Element;
|
||||
showChooseGroupMembers: () => void;
|
||||
showConversation: ShowConversationType;
|
||||
} & LookupConversationWithoutUuidActionsType;
|
||||
} & LookupConversationWithoutServiceIdActionsType;
|
||||
|
||||
const NORMAL_ROW_HEIGHT = 76;
|
||||
const SELECT_ROW_HEIGHT = 52;
|
||||
|
@ -214,7 +214,7 @@ export function ConversationList({
|
|||
scrollable = true,
|
||||
shouldRecomputeRowHeights,
|
||||
showChooseGroupMembers,
|
||||
lookupConversationWithoutUuid,
|
||||
lookupConversationWithoutServiceId,
|
||||
showUserNotFoundModal,
|
||||
setIsFetchingUUID,
|
||||
showConversation,
|
||||
|
@ -313,7 +313,9 @@ export function ConversationList({
|
|||
result = (
|
||||
<PhoneNumberCheckboxComponent
|
||||
phoneNumber={row.phoneNumber}
|
||||
lookupConversationWithoutUuid={lookupConversationWithoutUuid}
|
||||
lookupConversationWithoutServiceId={
|
||||
lookupConversationWithoutServiceId
|
||||
}
|
||||
showUserNotFoundModal={showUserNotFoundModal}
|
||||
setIsFetchingUUID={setIsFetchingUUID}
|
||||
toggleConversationInChooseMembers={conversationId =>
|
||||
|
@ -330,7 +332,9 @@ export function ConversationList({
|
|||
result = (
|
||||
<UsernameCheckboxComponent
|
||||
username={row.username}
|
||||
lookupConversationWithoutUuid={lookupConversationWithoutUuid}
|
||||
lookupConversationWithoutServiceId={
|
||||
lookupConversationWithoutServiceId
|
||||
}
|
||||
showUserNotFoundModal={showUserNotFoundModal}
|
||||
setIsFetchingUUID={setIsFetchingUUID}
|
||||
toggleConversationInChooseMembers={conversationId =>
|
||||
|
@ -436,7 +440,9 @@ export function ConversationList({
|
|||
i18n={i18n}
|
||||
phoneNumber={row.phoneNumber}
|
||||
isFetching={row.isFetching}
|
||||
lookupConversationWithoutUuid={lookupConversationWithoutUuid}
|
||||
lookupConversationWithoutServiceId={
|
||||
lookupConversationWithoutServiceId
|
||||
}
|
||||
showUserNotFoundModal={showUserNotFoundModal}
|
||||
setIsFetchingUUID={setIsFetchingUUID}
|
||||
showConversation={showConversation}
|
||||
|
@ -449,7 +455,9 @@ export function ConversationList({
|
|||
i18n={i18n}
|
||||
username={row.username}
|
||||
isFetchingUsername={row.isFetchingUsername}
|
||||
lookupConversationWithoutUuid={lookupConversationWithoutUuid}
|
||||
lookupConversationWithoutServiceId={
|
||||
lookupConversationWithoutServiceId
|
||||
}
|
||||
showUserNotFoundModal={showUserNotFoundModal}
|
||||
setIsFetchingUUID={setIsFetchingUUID}
|
||||
showConversation={showConversation}
|
||||
|
@ -473,7 +481,7 @@ export function ConversationList({
|
|||
getPreferredBadge,
|
||||
getRow,
|
||||
i18n,
|
||||
lookupConversationWithoutUuid,
|
||||
lookupConversationWithoutServiceId,
|
||||
onClickArchiveButton,
|
||||
onClickContactCheckbox,
|
||||
onOutgoingAudioCallInConversation,
|
||||
|
|
|
@ -358,7 +358,9 @@ export function ForwardMessagesModal({
|
|||
toggleSelectedConversation(conversationId);
|
||||
}
|
||||
}}
|
||||
lookupConversationWithoutUuid={asyncShouldNeverBeCalled}
|
||||
lookupConversationWithoutServiceId={
|
||||
asyncShouldNeverBeCalled
|
||||
}
|
||||
showConversation={shouldNeverBeCalled}
|
||||
showUserNotFoundModal={shouldNeverBeCalled}
|
||||
setIsFetchingUUID={shouldNeverBeCalled}
|
||||
|
|
|
@ -10,6 +10,7 @@ import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant';
|
|||
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
|
||||
import { FRAME_BUFFER_SIZE } from '../calling/constants';
|
||||
import { setupI18n } from '../util/setupI18n';
|
||||
import { generateAci } from '../types/ServiceId';
|
||||
import enMessages from '../../_locales/en/messages.json';
|
||||
|
||||
const i18n = setupI18n('en', enMessages);
|
||||
|
@ -60,7 +61,7 @@ const createProps = (
|
|||
isBlocked: Boolean(isBlocked),
|
||||
title:
|
||||
'Pablo Diego José Francisco de Paula Juan Nepomuceno María de los Remedios Cipriano de la Santísima Trinidad Ruiz y Picasso',
|
||||
uuid: '992ed3b9-fc9b-47a9-bdb4-e0c7cbb0fda5',
|
||||
uuid: generateAci(),
|
||||
}),
|
||||
},
|
||||
remoteParticipantsCount: 1,
|
||||
|
|
|
@ -31,9 +31,9 @@ import { DialogType } from '../types/Dialogs';
|
|||
import { SocketStatus } from '../types/SocketStatus';
|
||||
import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext';
|
||||
import {
|
||||
makeFakeLookupConversationWithoutUuid,
|
||||
makeFakeLookupConversationWithoutServiceId,
|
||||
useUuidFetchState,
|
||||
} from '../test-both/helpers/fakeLookupConversationWithoutUuid';
|
||||
} from '../test-both/helpers/fakeLookupConversationWithoutServiceId';
|
||||
import type { GroupListItemConversationType } from './conversationList/GroupListItem';
|
||||
|
||||
const i18n = setupI18n('en', enMessages);
|
||||
|
@ -168,7 +168,8 @@ const useProps = (overrideProps: OverridePropsType = {}): PropsType => {
|
|||
navTabsCollapsed: boolean('navTabsCollapsed', false),
|
||||
|
||||
setChallengeStatus: action('setChallengeStatus'),
|
||||
lookupConversationWithoutUuid: makeFakeLookupConversationWithoutUuid(),
|
||||
lookupConversationWithoutServiceId:
|
||||
makeFakeLookupConversationWithoutServiceId(),
|
||||
showUserNotFoundModal: action('showUserNotFoundModal'),
|
||||
setIsFetchingUUID,
|
||||
showConversation: action('showConversation'),
|
||||
|
|
|
@ -29,7 +29,7 @@ import type { DurationInSeconds } from '../util/durations';
|
|||
import type { WidthBreakpoint } from './_util';
|
||||
import { getNavSidebarWidthBreakpoint } from './_util';
|
||||
import * as KeyboardLayout from '../services/keyboardLayout';
|
||||
import type { LookupConversationWithoutUuidActionsType } from '../util/lookupConversationWithoutUuid';
|
||||
import type { LookupConversationWithoutServiceIdActionsType } from '../util/lookupConversationWithoutServiceId';
|
||||
import type { ShowConversationType } from '../state/ducks/conversations';
|
||||
import type { PropsType as UnsupportedOSDialogPropsType } from '../state/smart/UnsupportedOSDialog';
|
||||
|
||||
|
@ -152,7 +152,7 @@ export type PropsType = {
|
|||
renderCaptchaDialog: (props: { onSkip(): void }) => JSX.Element;
|
||||
renderCrashReportDialog: () => JSX.Element;
|
||||
renderExpiredBuildDialog: (_: DialogExpiredBuildPropsType) => JSX.Element;
|
||||
} & LookupConversationWithoutUuidActionsType;
|
||||
} & LookupConversationWithoutServiceIdActionsType;
|
||||
|
||||
export function LeftPane({
|
||||
blockConversation,
|
||||
|
@ -173,7 +173,7 @@ export function LeftPane({
|
|||
hasRelinkDialog,
|
||||
hasUpdateDialog,
|
||||
i18n,
|
||||
lookupConversationWithoutUuid,
|
||||
lookupConversationWithoutServiceId,
|
||||
isMacOS,
|
||||
isUpdateDownloaded,
|
||||
isContactManagementEnabled,
|
||||
|
@ -657,8 +657,8 @@ export function LeftPane({
|
|||
}}
|
||||
showUserNotFoundModal={showUserNotFoundModal}
|
||||
setIsFetchingUUID={setIsFetchingUUID}
|
||||
lookupConversationWithoutUuid={
|
||||
lookupConversationWithoutUuid
|
||||
lookupConversationWithoutServiceId={
|
||||
lookupConversationWithoutServiceId
|
||||
}
|
||||
showConversation={showConversation}
|
||||
blockConversation={blockConversation}
|
||||
|
|
|
@ -5,6 +5,7 @@ import type { Meta, Story } from '@storybook/react';
|
|||
import { action } from '@storybook/addon-actions';
|
||||
import React, { useState } from 'react';
|
||||
import casual from 'casual';
|
||||
import { v4 as generateUuid } from 'uuid';
|
||||
|
||||
import type { PropsType } from './ProfileEditor';
|
||||
import enMessages from '../../_locales/en/messages.json';
|
||||
|
@ -15,7 +16,6 @@ import {
|
|||
UsernameLinkState,
|
||||
UsernameReservationState,
|
||||
} from '../state/ducks/usernameEnums';
|
||||
import { UUID } from '../types/UUID';
|
||||
import { getRandomColor } from '../test-both/helpers/getRandomColor';
|
||||
import { setupI18n } from '../util/setupI18n';
|
||||
|
||||
|
@ -35,7 +35,7 @@ export default {
|
|||
defaultValue: undefined,
|
||||
},
|
||||
conversationId: {
|
||||
defaultValue: UUID.generate().toString(),
|
||||
defaultValue: generateUuid(),
|
||||
},
|
||||
color: {
|
||||
defaultValue: getRandomColor(),
|
||||
|
|
|
@ -11,6 +11,7 @@ import enMessages from '../../_locales/en/messages.json';
|
|||
import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext';
|
||||
import { getFakeBadge } from '../test-both/helpers/getFakeBadge';
|
||||
import { MY_STORY_ID } from '../types/Stories';
|
||||
import { generateStoryDistributionId } from '../types/StoryDistributionId';
|
||||
|
||||
const i18n = setupI18n('en', enMessages);
|
||||
|
||||
|
@ -254,7 +255,7 @@ export function NoContacts(): JSX.Element {
|
|||
story: {
|
||||
name: 'Custom List A',
|
||||
conversationId: 'our-conversation-id',
|
||||
distributionId: 'some-other-distribution-id',
|
||||
distributionId: generateStoryDistributionId(),
|
||||
},
|
||||
contacts: [],
|
||||
},
|
||||
|
@ -290,7 +291,7 @@ export function InMultipleStories(): JSX.Element {
|
|||
story: {
|
||||
name: 'Custom List A',
|
||||
conversationId: 'our-conversation-id',
|
||||
distributionId: 'some-other-distribution-id',
|
||||
distributionId: generateStoryDistributionId(),
|
||||
},
|
||||
contacts: [
|
||||
contactWithAllData,
|
||||
|
|
|
@ -21,7 +21,8 @@ import { ContextMenu } from './ContextMenu';
|
|||
import { Theme } from '../util/theme';
|
||||
import { isNotNil } from '../util/isNotNil';
|
||||
import { MY_STORY_ID } from '../types/Stories';
|
||||
import type { UUIDStringType } from '../types/UUID';
|
||||
import type { ServiceIdString } from '../types/ServiceId';
|
||||
import type { StoryDistributionIdString } from '../types/StoryDistributionId';
|
||||
import { UserText } from './UserText';
|
||||
|
||||
export enum SafetyNumberChangeSource {
|
||||
|
@ -48,7 +49,7 @@ type StoryContacts = {
|
|||
// For My Story or custom distribution lists, conversationId will be our own
|
||||
conversationId: string;
|
||||
// For Group stories, distributionId will not be provided
|
||||
distributionId?: string;
|
||||
distributionId?: StoryDistributionIdString;
|
||||
};
|
||||
contacts: Array<ConversationType>;
|
||||
};
|
||||
|
@ -62,8 +63,8 @@ export type Props = Readonly<{
|
|||
onCancel: () => void;
|
||||
onConfirm: () => void;
|
||||
removeFromStory?: (
|
||||
distributionId: string,
|
||||
uuids: Array<UUIDStringType>
|
||||
distributionId: StoryDistributionIdString,
|
||||
serviceIds: Array<ServiceIdString>
|
||||
) => unknown;
|
||||
renderSafetyNumber: (props: SafetyNumberProps) => JSX.Element;
|
||||
theme: ThemeType;
|
||||
|
@ -275,8 +276,8 @@ function ContactSection({
|
|||
getPreferredBadge: PreferredBadgeSelectorType;
|
||||
i18n: LocalizerType;
|
||||
removeFromStory?: (
|
||||
distributionId: string,
|
||||
uuids: Array<UUIDStringType>
|
||||
distributionId: StoryDistributionIdString,
|
||||
serviceIds: Array<ServiceIdString>
|
||||
) => unknown;
|
||||
setSelectedContact: (contact: ConversationType) => void;
|
||||
theme: ThemeType;
|
||||
|
@ -431,12 +432,12 @@ function ContactRow({
|
|||
theme,
|
||||
}: Readonly<{
|
||||
contact: ConversationType;
|
||||
distributionId?: string;
|
||||
distributionId?: StoryDistributionIdString;
|
||||
getPreferredBadge: PreferredBadgeSelectorType;
|
||||
i18n: LocalizerType;
|
||||
removeFromStory?: (
|
||||
distributionId: string,
|
||||
uuids: Array<UUIDStringType>
|
||||
distributionId: StoryDistributionIdString,
|
||||
serviceIds: Array<ServiceIdString>
|
||||
) => unknown;
|
||||
setSelectedContact: (contact: ConversationType) => void;
|
||||
shouldShowNumber: boolean;
|
||||
|
|
|
@ -21,7 +21,8 @@ import {
|
|||
Page as StoriesSettingsPage,
|
||||
} from './StoriesSettingsModal';
|
||||
import type { StoryDistributionListWithMembersDataType } from '../types/Stories';
|
||||
import type { UUIDStringType } from '../types/UUID';
|
||||
import type { StoryDistributionIdString } from '../types/StoryDistributionId';
|
||||
import type { ServiceIdString } from '../types/ServiceId';
|
||||
import { Alert } from './Alert';
|
||||
import { Avatar, AvatarSize } from './Avatar';
|
||||
import { Button, ButtonSize, ButtonVariant } from './Button';
|
||||
|
@ -54,18 +55,18 @@ export type PropsType = {
|
|||
i18n: LocalizerType;
|
||||
me: ConversationType;
|
||||
onClose: () => unknown;
|
||||
onDeleteList: (listId: string) => unknown;
|
||||
onDeleteList: (listId: StoryDistributionIdString) => unknown;
|
||||
onDistributionListCreated: (
|
||||
name: string,
|
||||
viewerUuids: Array<UUIDStringType>
|
||||
) => Promise<UUIDStringType>;
|
||||
viewerUuids: Array<ServiceIdString>
|
||||
) => Promise<StoryDistributionIdString>;
|
||||
onSelectedStoryList: (options: {
|
||||
conversationId: string;
|
||||
distributionId: string | undefined;
|
||||
uuids: Array<UUIDStringType>;
|
||||
distributionId: StoryDistributionIdString | undefined;
|
||||
serviceIds: Array<ServiceIdString>;
|
||||
}) => unknown;
|
||||
onSend: (
|
||||
listIds: Array<UUIDStringType>,
|
||||
listIds: Array<StoryDistributionIdString>,
|
||||
conversationIds: Array<string>
|
||||
) => unknown;
|
||||
signalConnections: Array<ConversationType>;
|
||||
|
@ -99,21 +100,23 @@ const Page = {
|
|||
|
||||
type PageType = SendStoryPage | StoriesSettingsPage;
|
||||
|
||||
function getListMemberUuids(
|
||||
function getListMemberServiceIds(
|
||||
list: StoryDistributionListWithMembersDataType,
|
||||
signalConnections: Array<ConversationType>
|
||||
): Array<UUIDStringType> {
|
||||
const memberUuids = list.members.map(({ uuid }) => uuid).filter(isNotNil);
|
||||
): Array<ServiceIdString> {
|
||||
const memberServiceIds = list.members
|
||||
.map(({ uuid }) => uuid)
|
||||
.filter(isNotNil);
|
||||
|
||||
if (list.id === MY_STORY_ID && list.isBlockList) {
|
||||
const excludeUuids = new Set<string>(memberUuids);
|
||||
const excludeUuids = new Set<string>(memberServiceIds);
|
||||
return signalConnections
|
||||
.map(conversation => conversation.uuid)
|
||||
.filter(isNotNil)
|
||||
.filter(uuid => !excludeUuids.has(uuid));
|
||||
}
|
||||
|
||||
return memberUuids;
|
||||
return memberServiceIds;
|
||||
}
|
||||
|
||||
export function SendStoryModal({
|
||||
|
@ -147,9 +150,9 @@ export function SendStoryModal({
|
|||
|
||||
const [confirmDiscardModal, confirmDiscardIf] = useConfirmDiscard(i18n);
|
||||
|
||||
const [selectedListIds, setSelectedListIds] = useState<Set<UUIDStringType>>(
|
||||
new Set()
|
||||
);
|
||||
const [selectedListIds, setSelectedListIds] = useState<
|
||||
Set<StoryDistributionIdString>
|
||||
>(new Set());
|
||||
const [selectedGroupIds, setSelectedGroupIds] = useState<Set<string>>(
|
||||
new Set()
|
||||
);
|
||||
|
@ -215,7 +218,7 @@ export function SendStoryModal({
|
|||
string | undefined
|
||||
>();
|
||||
const [confirmDeleteList, setConfirmDeleteList] = useState<
|
||||
{ id: string; name: string } | undefined
|
||||
{ id: StoryDistributionIdString; name: string } | undefined
|
||||
>();
|
||||
|
||||
const [listIdToEdit, setListIdToEdit] = useState<string | undefined>();
|
||||
|
@ -263,7 +266,7 @@ export function SendStoryModal({
|
|||
selectedNames = chosenGroupNames.join(', ');
|
||||
} else {
|
||||
selectedNames = selectedStoryNames
|
||||
.map(listName => getStoryDistributionListName(i18n, listName, listName))
|
||||
.map(listName => getStoryDistributionListName(i18n, undefined, listName))
|
||||
.join(', ');
|
||||
}
|
||||
|
||||
|
@ -661,7 +664,7 @@ export function SendStoryModal({
|
|||
onSelectedStoryList({
|
||||
conversationId: ourConversationId,
|
||||
distributionId: list.id,
|
||||
uuids: getListMemberUuids(list, signalConnections),
|
||||
serviceIds: getListMemberServiceIds(list, signalConnections),
|
||||
});
|
||||
}
|
||||
}}
|
||||
|
@ -792,7 +795,7 @@ export function SendStoryModal({
|
|||
onSelectedStoryList({
|
||||
conversationId: group.id,
|
||||
distributionId: undefined,
|
||||
uuids: group.memberships.map(({ uuid }) => uuid),
|
||||
serviceIds: group.memberships.map(({ uuid }) => uuid),
|
||||
});
|
||||
}
|
||||
}}
|
||||
|
|
|
@ -115,7 +115,9 @@ export const SingleList = Template.bind({});
|
|||
},
|
||||
{
|
||||
...fakeDistroList,
|
||||
members: fakeDistroList.memberUuids.map(() => getDefaultConversation()),
|
||||
members: fakeDistroList.memberServiceIds.map(() =>
|
||||
getDefaultConversation()
|
||||
),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
@ -11,7 +11,8 @@ import type { LocalizerType } from '../types/Util';
|
|||
import type { PreferredBadgeSelectorType } from '../state/selectors/badges';
|
||||
import type { Row } from './ConversationList';
|
||||
import type { StoryDistributionListWithMembersDataType } from '../types/Stories';
|
||||
import type { UUIDStringType } from '../types/UUID';
|
||||
import type { StoryDistributionIdString } from '../types/StoryDistributionId';
|
||||
import type { ServiceIdString } from '../types/ServiceId';
|
||||
import type { RenderModalPage, ModalPropsType } from './Modal';
|
||||
import { Avatar, AvatarSize } from './Avatar';
|
||||
import { Button, ButtonVariant } from './Button';
|
||||
|
@ -28,7 +29,6 @@ import { SearchInput } from './SearchInput';
|
|||
import { StoryDistributionListName } from './StoryDistributionListName';
|
||||
import { Theme } from '../util/theme';
|
||||
import { ThemeType } from '../types/Util';
|
||||
import { UUID } from '../types/UUID';
|
||||
import { filterAndSortConversationsByRecent } from '../util/filterAndSortConversations';
|
||||
import { isNotNil } from '../util/isNotNil';
|
||||
import {
|
||||
|
@ -54,23 +54,25 @@ export type PropsType = {
|
|||
toggleGroupsForStorySend: (groupIds: Array<string>) => unknown;
|
||||
onDistributionListCreated: (
|
||||
name: string,
|
||||
viewerUuids: Array<UUIDStringType>
|
||||
viewerUuids: Array<ServiceIdString>
|
||||
) => Promise<string>;
|
||||
onHideMyStoriesFrom: (viewerUuids: Array<UUIDStringType>) => unknown;
|
||||
onRemoveMembers: (listId: string, uuids: Array<UUIDStringType>) => unknown;
|
||||
onHideMyStoriesFrom: (viewerUuids: Array<ServiceIdString>) => unknown;
|
||||
onRemoveMembers: (listId: string, uuids: Array<ServiceIdString>) => unknown;
|
||||
onRepliesNReactionsChanged: (
|
||||
listId: string,
|
||||
allowsReplies: boolean
|
||||
) => unknown;
|
||||
onViewersUpdated: (
|
||||
listId: string,
|
||||
viewerUuids: Array<UUIDStringType>
|
||||
viewerUuids: Array<ServiceIdString>
|
||||
) => unknown;
|
||||
setMyStoriesToAllSignalConnections: () => unknown;
|
||||
storyViewReceiptsEnabled: boolean;
|
||||
toggleSignalConnectionsModal: () => unknown;
|
||||
setStoriesDisabled: (value: boolean) => void;
|
||||
getConversationByUuid: (uuid: UUIDStringType) => ConversationType | undefined;
|
||||
getConversationByUuid: (
|
||||
uuid: ServiceIdString
|
||||
) => ConversationType | undefined;
|
||||
};
|
||||
|
||||
export enum Page {
|
||||
|
@ -134,7 +136,7 @@ type DistributionListItemProps = {
|
|||
distributionList: StoryDistributionListWithMembersDataType;
|
||||
me: ConversationType;
|
||||
signalConnections: Array<ConversationType>;
|
||||
onSelectItemToEdit(id: UUIDStringType): void;
|
||||
onSelectItemToEdit(id: StoryDistributionIdString): void;
|
||||
};
|
||||
|
||||
function DistributionListItem({
|
||||
|
@ -543,7 +545,10 @@ type DistributionListSettingsModalPropsType = {
|
|||
i18n: LocalizerType;
|
||||
listToEdit: StoryDistributionListWithMembersDataType;
|
||||
signalConnectionsCount: number;
|
||||
setConfirmDeleteList: (_: { id: string; name: string }) => unknown;
|
||||
setConfirmDeleteList: (_: {
|
||||
id: StoryDistributionIdString;
|
||||
name: string;
|
||||
}) => unknown;
|
||||
setPage: (page: Page) => unknown;
|
||||
setSelectedContacts: (contacts: Array<ConversationType>) => unknown;
|
||||
onBackButtonClick: (() => void) | undefined;
|
||||
|
@ -577,7 +582,7 @@ export function DistributionListSettingsModal({
|
|||
| {
|
||||
listId: string;
|
||||
title: string;
|
||||
uuid: UUIDStringType;
|
||||
uuid: ServiceIdString;
|
||||
}
|
||||
>();
|
||||
|
||||
|
@ -945,8 +950,8 @@ export function EditMyStoryPrivacy({
|
|||
}
|
||||
|
||||
type EditDistributionListModalPropsType = {
|
||||
onCreateList: (name: string, viewerUuids: Array<UUIDStringType>) => unknown;
|
||||
onViewersUpdated: (viewerUuids: Array<UUIDStringType>) => unknown;
|
||||
onCreateList: (name: string, viewerUuids: Array<ServiceIdString>) => unknown;
|
||||
onViewersUpdated: (viewerUuids: Array<ServiceIdString>) => unknown;
|
||||
page:
|
||||
| Page.AddViewer
|
||||
| Page.ChooseViewers
|
||||
|
@ -998,7 +1003,7 @@ export function EditDistributionListModal({
|
|||
return map;
|
||||
}, [candidateConversations]);
|
||||
|
||||
const selectedConversationUuids: Set<UUIDStringType> = useMemo(
|
||||
const selectConversationServiceIds: Set<ServiceIdString> = useMemo(
|
||||
() =>
|
||||
new Set(selectedContacts.map(contact => contact.uuid).filter(isNotNil)),
|
||||
[selectedContacts]
|
||||
|
@ -1034,7 +1039,7 @@ export function EditDistributionListModal({
|
|||
<Button
|
||||
disabled={!storyName}
|
||||
onClick={() => {
|
||||
onCreateList(storyName, Array.from(selectedConversationUuids));
|
||||
onCreateList(storyName, Array.from(selectConversationServiceIds));
|
||||
setStoryName('');
|
||||
}}
|
||||
variant={ButtonVariant.Primary}
|
||||
|
@ -1105,7 +1110,7 @@ export function EditDistributionListModal({
|
|||
return undefined;
|
||||
}
|
||||
|
||||
const isSelected = selectedConversationUuids.has(UUID.cast(contact.uuid));
|
||||
const isSelected = selectConversationServiceIds.has(contact.uuid);
|
||||
|
||||
return {
|
||||
type: RowType.ContactCheckbox,
|
||||
|
@ -1120,7 +1125,7 @@ export function EditDistributionListModal({
|
|||
<Button
|
||||
disabled={selectedContacts.length === 0}
|
||||
onClick={() => {
|
||||
onViewersUpdated(Array.from(selectedConversationUuids));
|
||||
onViewersUpdated(Array.from(selectConversationServiceIds));
|
||||
}}
|
||||
variant={ButtonVariant.Primary}
|
||||
>
|
||||
|
@ -1132,7 +1137,7 @@ export function EditDistributionListModal({
|
|||
<Button
|
||||
disabled={selectedContacts.length === 0}
|
||||
onClick={() => {
|
||||
onViewersUpdated(Array.from(selectedConversationUuids));
|
||||
onViewersUpdated(Array.from(selectConversationServiceIds));
|
||||
}}
|
||||
variant={ButtonVariant.Primary}
|
||||
>
|
||||
|
@ -1197,7 +1202,7 @@ export function EditDistributionListModal({
|
|||
getPreferredBadge={getPreferredBadge}
|
||||
getRow={getRow}
|
||||
i18n={i18n}
|
||||
lookupConversationWithoutUuid={asyncShouldNeverBeCalled}
|
||||
lookupConversationWithoutServiceId={asyncShouldNeverBeCalled}
|
||||
onClickArchiveButton={shouldNeverBeCalled}
|
||||
onClickContactCheckbox={(conversationId: string) => {
|
||||
toggleSelectedConversation(conversationId);
|
||||
|
@ -1236,7 +1241,7 @@ type GroupStorySettingsModalProps = {
|
|||
group: ConversationType;
|
||||
onClose(): void;
|
||||
onBackButtonClick(): void;
|
||||
getConversationByUuid(uuid: UUIDStringType): ConversationType | undefined;
|
||||
getConversationByUuid(uuid: ServiceIdString): ConversationType | undefined;
|
||||
onRemoveGroup(group: ConversationType): void;
|
||||
};
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import type { LinkPreviewType } from '../types/message/LinkPreviews';
|
|||
import type { LocalizerType } from '../types/Util';
|
||||
import type { Props as StickerButtonProps } from './stickers/StickerButton';
|
||||
import type { PropsType as SendStoryModalPropsType } from './SendStoryModal';
|
||||
import type { UUIDStringType } from '../types/UUID';
|
||||
import type { StoryDistributionIdString } from '../types/StoryDistributionId';
|
||||
import type { imageToBlurHash } from '../util/imageToBlurHash';
|
||||
import type { PropsType as TextStoryCreatorPropsType } from './TextStoryCreator';
|
||||
|
||||
|
@ -54,7 +54,7 @@ export type PropsType = {
|
|||
linkPreview?: LinkPreviewType;
|
||||
onClose: () => unknown;
|
||||
onSend: (
|
||||
listIds: Array<UUIDStringType>,
|
||||
listIds: Array<StoryDistributionIdString>,
|
||||
conversationIds: Array<string>,
|
||||
attachment: AttachmentType,
|
||||
bodyRanges: DraftBodyRanges | undefined
|
||||
|
|
|
@ -5,11 +5,12 @@ import React from 'react';
|
|||
|
||||
import type { LocalizerType } from '../types/Util';
|
||||
import { getStoryDistributionListName } from '../types/Stories';
|
||||
import type { StoryDistributionIdString } from '../types/StoryDistributionId';
|
||||
import { UserText } from './UserText';
|
||||
|
||||
type PropsType = {
|
||||
i18n: LocalizerType;
|
||||
id: string;
|
||||
id: StoryDistributionIdString | string;
|
||||
name: string;
|
||||
};
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ import type { PropsType } from './StoryViewer';
|
|||
import enMessages from '../../_locales/en/messages.json';
|
||||
import { SendStatus } from '../messages/MessageSendState';
|
||||
import { StoryViewModeType } from '../types/Stories';
|
||||
import { generateStoryDistributionId } from '../types/StoryDistributionId';
|
||||
import { StoryViewer } from './StoryViewer';
|
||||
import { VIDEO_MP4 } from '../types/MIME';
|
||||
import { fakeAttachment } from '../test-both/helpers/fakeAttachment';
|
||||
|
@ -170,7 +171,10 @@ export const YourStory = Template.bind({});
|
|||
);
|
||||
|
||||
YourStory.args = {
|
||||
distributionList: { id: '123', name: 'Close Friends' },
|
||||
distributionList: {
|
||||
id: generateStoryDistributionId(),
|
||||
name: 'Close Friends',
|
||||
},
|
||||
story: {
|
||||
...storyView,
|
||||
sender: {
|
||||
|
@ -203,7 +207,10 @@ export const YourStoryFailed = Template.bind({});
|
|||
);
|
||||
|
||||
YourStoryFailed.args = {
|
||||
distributionList: { id: '123', name: 'Close Friends' },
|
||||
distributionList: {
|
||||
id: generateStoryDistributionId(),
|
||||
name: 'Close Friends',
|
||||
},
|
||||
story: {
|
||||
...storyView,
|
||||
sender: {
|
||||
|
|
|
@ -21,6 +21,7 @@ import type { EmojiPickDataType } from './emoji/EmojiPicker';
|
|||
import type { PreferredBadgeSelectorType } from '../state/selectors/badges';
|
||||
import type { RenderEmojiPickerProps } from './conversation/ReactionPicker';
|
||||
import type { ReplyStateType, StoryViewType } from '../types/Stories';
|
||||
import type { StoryDistributionIdString } from '../types/StoryDistributionId';
|
||||
import type { ShowToastAction } from '../state/ducks/toast';
|
||||
import type { ViewStoryActionCreatorType } from '../state/ducks/stories';
|
||||
import * as log from '../logging/log';
|
||||
|
@ -66,7 +67,7 @@ export type PropsType = {
|
|||
deleteGroupStoryReply: (id: string) => void;
|
||||
deleteGroupStoryReplyForEveryone: (id: string) => void;
|
||||
deleteStoryForEveryone: (story: StoryViewType) => unknown;
|
||||
distributionList?: { id: string; name: string };
|
||||
distributionList?: { id: StoryDistributionIdString; name: string };
|
||||
getPreferredBadge: PreferredBadgeSelectorType;
|
||||
group?: Pick<
|
||||
ConversationType,
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
import type { Meta, Story } from '@storybook/react';
|
||||
import React from 'react';
|
||||
import { v4 as generateUuid } from 'uuid';
|
||||
|
||||
import { useArgs } from '@storybook/addons';
|
||||
import type { PropsType } from './StoryViewsNRepliesModal';
|
||||
|
@ -10,7 +11,6 @@ import * as durations from '../util/durations';
|
|||
import enMessages from '../../_locales/en/messages.json';
|
||||
import { SendStatus } from '../messages/MessageSendState';
|
||||
import { StoryViewsNRepliesModal } from './StoryViewsNRepliesModal';
|
||||
import { UUID } from '../types/UUID';
|
||||
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
|
||||
import { setupI18n } from '../util/setupI18n';
|
||||
import { StoryViewTargetType } from '../types/Stories';
|
||||
|
@ -110,34 +110,34 @@ function getViewsAndReplies() {
|
|||
author: p2,
|
||||
body: 'So cute ❤️',
|
||||
conversationId: p2.id,
|
||||
id: UUID.generate().toString(),
|
||||
id: generateUuid(),
|
||||
timestamp: Date.now() - 24 * durations.MINUTE,
|
||||
},
|
||||
{
|
||||
author: p3,
|
||||
body: "That's awesome",
|
||||
conversationId: p3.id,
|
||||
id: UUID.generate().toString(),
|
||||
id: generateUuid(),
|
||||
timestamp: Date.now() - 13 * durations.MINUTE,
|
||||
},
|
||||
{
|
||||
author: p3,
|
||||
body: 'Very awesome',
|
||||
conversationId: p3.id,
|
||||
id: UUID.generate().toString(),
|
||||
id: generateUuid(),
|
||||
timestamp: Date.now() - 13 * durations.MINUTE,
|
||||
},
|
||||
{
|
||||
author: p3,
|
||||
body: 'Did I mention how awesome this is?',
|
||||
conversationId: p3.id,
|
||||
id: UUID.generate().toString(),
|
||||
id: generateUuid(),
|
||||
timestamp: Date.now() - 12 * durations.MINUTE,
|
||||
},
|
||||
{
|
||||
author: p4,
|
||||
conversationId: p4.id,
|
||||
id: UUID.generate().toString(),
|
||||
id: generateUuid(),
|
||||
reactionEmoji: '❤️',
|
||||
timestamp: Date.now() - 5 * durations.MINUTE,
|
||||
},
|
||||
|
@ -145,7 +145,7 @@ function getViewsAndReplies() {
|
|||
author: p6,
|
||||
body: 'Thanks everyone!',
|
||||
conversationId: p6.id,
|
||||
id: UUID.generate().toString(),
|
||||
id: generateUuid(),
|
||||
sendStateByConversationId: {
|
||||
[p1.id]: {
|
||||
status: SendStatus.Pending,
|
||||
|
|
|
@ -5,9 +5,17 @@ import * as React from 'react';
|
|||
|
||||
import { action } from '@storybook/addon-actions';
|
||||
|
||||
import { generateAci } from '../../types/ServiceId';
|
||||
import type { Props } from './AtMentionify';
|
||||
import { AtMentionify } from './AtMentionify';
|
||||
|
||||
const SERVICE_ID_1 = generateAci();
|
||||
const SERVICE_ID_2 = generateAci();
|
||||
const SERVICE_ID_3 = generateAci();
|
||||
const SERVICE_ID_4 = generateAci();
|
||||
const SERVICE_ID_5 = generateAci();
|
||||
const SERVICE_ID_6 = generateAci();
|
||||
|
||||
export default {
|
||||
title: 'Components/Conversation/AtMentionify',
|
||||
};
|
||||
|
@ -32,21 +40,21 @@ export function MultipleMentions(): JSX.Element {
|
|||
{
|
||||
start: 4,
|
||||
length: 1,
|
||||
mentionUuid: 'abc',
|
||||
mentionUuid: SERVICE_ID_1,
|
||||
replacementText: 'Professor Farnsworth',
|
||||
conversationID: 'x',
|
||||
},
|
||||
{
|
||||
start: 2,
|
||||
length: 1,
|
||||
mentionUuid: 'def',
|
||||
mentionUuid: SERVICE_ID_2,
|
||||
replacementText: 'Philip J Fry',
|
||||
conversationID: 'x',
|
||||
},
|
||||
{
|
||||
start: 0,
|
||||
length: 1,
|
||||
mentionUuid: 'xyz',
|
||||
mentionUuid: SERVICE_ID_3,
|
||||
replacementText: 'Yancy Fry',
|
||||
conversationID: 'x',
|
||||
},
|
||||
|
@ -65,21 +73,21 @@ export function ComplexMentions(): JSX.Element {
|
|||
{
|
||||
start: 80,
|
||||
length: 1,
|
||||
mentionUuid: 'ioe',
|
||||
mentionUuid: SERVICE_ID_4,
|
||||
replacementText: 'Cereal Killer',
|
||||
conversationID: 'x',
|
||||
},
|
||||
{
|
||||
start: 78,
|
||||
length: 1,
|
||||
mentionUuid: 'fdr',
|
||||
mentionUuid: SERVICE_ID_5,
|
||||
replacementText: 'Acid Burn',
|
||||
conversationID: 'x',
|
||||
},
|
||||
{
|
||||
start: 4,
|
||||
length: 1,
|
||||
mentionUuid: 'ope',
|
||||
mentionUuid: SERVICE_ID_6,
|
||||
replacementText: 'Zero Cool',
|
||||
conversationID: 'x',
|
||||
},
|
||||
|
@ -101,7 +109,7 @@ export function WithOddCharacter(): JSX.Element {
|
|||
{
|
||||
start: 4,
|
||||
length: 1,
|
||||
mentionUuid: 'ope',
|
||||
mentionUuid: SERVICE_ID_6,
|
||||
replacementText: 'Zero Cool',
|
||||
conversationID: 'x',
|
||||
},
|
||||
|
|
|
@ -7,6 +7,7 @@ import { action } from '@storybook/addon-actions';
|
|||
import { setupI18n } from '../../util/setupI18n';
|
||||
import enMessages from '../../../_locales/en/messages.json';
|
||||
import { CallMode } from '../../types/Calling';
|
||||
import { generateAci } from '../../types/ServiceId';
|
||||
import { CallingNotification, type PropsType } from './CallingNotification';
|
||||
import {
|
||||
getDefaultConversation,
|
||||
|
@ -19,7 +20,6 @@ import {
|
|||
GroupCallStatus,
|
||||
DirectCallStatus,
|
||||
} from '../../types/CallDisposition';
|
||||
import { UUID } from '../../types/UUID';
|
||||
import type { ConversationType } from '../../state/ducks/conversations';
|
||||
import { CallExternalState } from '../../util/callingNotification';
|
||||
|
||||
|
@ -45,7 +45,7 @@ const getCommonProps = (options: {
|
|||
? GroupCallStatus.GenericGroupCall
|
||||
: DirectCallStatus.Pending,
|
||||
callCreator = getDefaultConversation({
|
||||
uuid: UUID.generate().toString(),
|
||||
uuid: generateAci(),
|
||||
isMe: direction === CallDirection.Outgoing,
|
||||
}),
|
||||
callExternalState = CallExternalState.Active,
|
||||
|
|
|
@ -5,8 +5,8 @@ import * as React from 'react';
|
|||
import { action } from '@storybook/addon-actions';
|
||||
|
||||
import { setupI18n } from '../../util/setupI18n';
|
||||
import { UUID } from '../../types/UUID';
|
||||
import type { UUIDStringType } from '../../types/UUID';
|
||||
import { generateAci, generatePni } from '../../types/ServiceId';
|
||||
import type { ServiceIdString, AciString } from '../../types/ServiceId';
|
||||
import enMessages from '../../../_locales/en/messages.json';
|
||||
import type { GroupV2ChangeType } from '../../groups';
|
||||
import { SignalService as Proto } from '../../protobuf';
|
||||
|
@ -16,13 +16,13 @@ import type { FullJSXType } from '../Intl';
|
|||
|
||||
const i18n = setupI18n('en', enMessages);
|
||||
|
||||
const OUR_ACI = UUID.generate().toString();
|
||||
const OUR_PNI = UUID.generate().toString();
|
||||
const CONTACT_A = UUID.generate().toString();
|
||||
const CONTACT_B = UUID.generate().toString();
|
||||
const CONTACT_C = UUID.generate().toString();
|
||||
const ADMIN_A = UUID.generate().toString();
|
||||
const INVITEE_A = UUID.generate().toString();
|
||||
const OUR_ACI = generateAci();
|
||||
const OUR_PNI = generatePni();
|
||||
const CONTACT_A = generateAci();
|
||||
const CONTACT_B = generateAci();
|
||||
const CONTACT_C = generateAci();
|
||||
const ADMIN_A = generateAci();
|
||||
const INVITEE_A = generateAci();
|
||||
|
||||
const AccessControlEnum = Proto.AccessControl.AccessRequired;
|
||||
const RoleEnum = Proto.Member.Role;
|
||||
|
@ -44,10 +44,10 @@ const renderChange = (
|
|||
areWeAdmin = true,
|
||||
}: {
|
||||
groupMemberships?: ReadonlyArray<{
|
||||
uuid: UUIDStringType;
|
||||
uuid: AciString;
|
||||
isAdmin: boolean;
|
||||
}>;
|
||||
groupBannedMemberships?: ReadonlyArray<UUIDStringType>;
|
||||
groupBannedMemberships?: ReadonlyArray<ServiceIdString>;
|
||||
groupName?: string;
|
||||
areWeAdmin?: boolean;
|
||||
} = {}
|
||||
|
@ -61,8 +61,8 @@ const renderChange = (
|
|||
groupMemberships={groupMemberships}
|
||||
groupName={groupName}
|
||||
i18n={i18n}
|
||||
ourACI={OUR_ACI}
|
||||
ourPNI={OUR_PNI}
|
||||
ourAci={OUR_ACI}
|
||||
ourPni={OUR_PNI}
|
||||
renderContact={renderContact}
|
||||
/>
|
||||
);
|
||||
|
@ -94,10 +94,6 @@ export function Multiple(): JSX.Element {
|
|||
type: 'member-add',
|
||||
uuid: OUR_ACI,
|
||||
},
|
||||
{
|
||||
type: 'member-add',
|
||||
uuid: OUR_PNI,
|
||||
},
|
||||
{
|
||||
type: 'description',
|
||||
description: 'Another description',
|
||||
|
|
|
@ -10,7 +10,11 @@ import type { ReplacementValuesType } from '../../types/I18N';
|
|||
import type { FullJSXType } from '../Intl';
|
||||
import { Intl } from '../Intl';
|
||||
import type { LocalizerType } from '../../types/Util';
|
||||
import type { UUIDStringType } from '../../types/UUID';
|
||||
import type {
|
||||
AciString,
|
||||
PniString,
|
||||
ServiceIdString,
|
||||
} from '../../types/ServiceId';
|
||||
import { GroupDescriptionText } from '../GroupDescriptionText';
|
||||
import { Button, ButtonSize, ButtonVariant } from '../Button';
|
||||
import { SystemMessage } from './SystemMessage';
|
||||
|
@ -26,20 +30,20 @@ export type PropsDataType = {
|
|||
areWeAdmin: boolean;
|
||||
conversationId: string;
|
||||
groupMemberships?: ReadonlyArray<{
|
||||
uuid: UUIDStringType;
|
||||
uuid: AciString;
|
||||
isAdmin: boolean;
|
||||
}>;
|
||||
groupBannedMemberships?: ReadonlyArray<UUIDStringType>;
|
||||
groupBannedMemberships?: ReadonlyArray<ServiceIdString>;
|
||||
groupName?: string;
|
||||
ourACI?: UUIDStringType;
|
||||
ourPNI?: UUIDStringType;
|
||||
ourAci: AciString | undefined;
|
||||
ourPni: PniString | undefined;
|
||||
change: GroupV2ChangeType;
|
||||
};
|
||||
|
||||
export type PropsActionsType = {
|
||||
blockGroupLinkRequests: (
|
||||
conversationId: string,
|
||||
uuid: UUIDStringType
|
||||
serviceId: ServiceIdString
|
||||
) => unknown;
|
||||
};
|
||||
|
||||
|
@ -108,7 +112,7 @@ const changeToIconMap = new Map<string, GroupIconType>([
|
|||
function getIcon(
|
||||
detail: GroupV2ChangeDetailType,
|
||||
isLastText = true,
|
||||
fromId?: UUIDStringType
|
||||
fromId?: ServiceIdString
|
||||
): GroupIconType {
|
||||
const changeType = detail.type;
|
||||
let possibleIcon = changeToIconMap.get(changeType);
|
||||
|
@ -143,29 +147,27 @@ function GroupV2Detail({
|
|||
groupBannedMemberships,
|
||||
groupName,
|
||||
i18n,
|
||||
ourACI,
|
||||
ourPNI,
|
||||
ourAci,
|
||||
renderContact,
|
||||
text,
|
||||
}: {
|
||||
areWeAdmin: boolean;
|
||||
blockGroupLinkRequests: (
|
||||
conversationId: string,
|
||||
uuid: UUIDStringType
|
||||
uuid: ServiceIdString
|
||||
) => unknown;
|
||||
conversationId: string;
|
||||
detail: GroupV2ChangeDetailType;
|
||||
isLastText: boolean;
|
||||
groupMemberships?: ReadonlyArray<{
|
||||
uuid: UUIDStringType;
|
||||
uuid: AciString;
|
||||
isAdmin: boolean;
|
||||
}>;
|
||||
groupBannedMemberships?: ReadonlyArray<UUIDStringType>;
|
||||
groupBannedMemberships?: ReadonlyArray<ServiceIdString>;
|
||||
groupName?: string;
|
||||
i18n: LocalizerType;
|
||||
fromId?: UUIDStringType;
|
||||
ourACI?: UUIDStringType;
|
||||
ourPNI?: UUIDStringType;
|
||||
fromId?: ServiceIdString;
|
||||
ourAci: AciString | undefined;
|
||||
renderContact: SmartContactRendererType<FullJSXType>;
|
||||
text: FullJSXType;
|
||||
}): JSX.Element {
|
||||
|
@ -260,8 +262,7 @@ function GroupV2Detail({
|
|||
detail.type === 'admin-approval-bounce' &&
|
||||
areWeAdmin &&
|
||||
detail.uuid &&
|
||||
detail.uuid !== ourACI &&
|
||||
detail.uuid !== ourPNI &&
|
||||
detail.uuid !== ourAci &&
|
||||
(!fromId || fromId === detail.uuid) &&
|
||||
!groupMemberships?.some(item => item.uuid === detail.uuid) &&
|
||||
!groupBannedMemberships?.some(uuid => uuid === detail.uuid)
|
||||
|
@ -297,8 +298,8 @@ export function GroupV2Change(props: PropsType): ReactElement {
|
|||
groupMemberships,
|
||||
groupName,
|
||||
i18n,
|
||||
ourACI,
|
||||
ourPNI,
|
||||
ourAci,
|
||||
ourPni,
|
||||
renderContact,
|
||||
} = props;
|
||||
|
||||
|
@ -306,8 +307,8 @@ export function GroupV2Change(props: PropsType): ReactElement {
|
|||
<>
|
||||
{renderChange<FullJSXType>(change, {
|
||||
i18n,
|
||||
ourACI,
|
||||
ourPNI,
|
||||
ourAci,
|
||||
ourPni,
|
||||
renderContact,
|
||||
renderString: renderStringToIntl,
|
||||
}).map(({ detail, isLastText, text }, index) => {
|
||||
|
@ -326,8 +327,7 @@ export function GroupV2Change(props: PropsType): ReactElement {
|
|||
// Difficult to find a unique key for this type
|
||||
// eslint-disable-next-line react/no-array-index-key
|
||||
key={index}
|
||||
ourACI={ourACI}
|
||||
ourPNI={ourPNI}
|
||||
ourAci={ourAci}
|
||||
renderContact={renderContact}
|
||||
text={text}
|
||||
/>
|
||||
|
|
|
@ -84,7 +84,7 @@ import type {
|
|||
import { createRefMerger } from '../../util/refMerger';
|
||||
import { emojiToData, getEmojiCount, hasNonEmojiText } from '../emoji/lib';
|
||||
import { getCustomColorStyle } from '../../util/getCustomColorStyle';
|
||||
import type { UUIDStringType } from '../../types/UUID';
|
||||
import type { ServiceIdString } from '../../types/ServiceId';
|
||||
import { DAY, HOUR, MINUTE, SECOND } from '../../util/durations';
|
||||
import { BadgeImageTheme } from '../../badges/BadgeImageTheme';
|
||||
import { getBadgeImageFileLocalPath } from '../../badges/getBadgeImageFileLocalPath';
|
||||
|
@ -319,7 +319,7 @@ export type PropsActions = {
|
|||
messageExpanded: (id: string, displayLimit: number) => unknown;
|
||||
checkForAccount: (phoneNumber: string) => unknown;
|
||||
|
||||
startConversation: (e164: string, uuid: UUIDStringType) => void;
|
||||
startConversation: (e164: string, uuid: ServiceIdString) => void;
|
||||
showConversation: ShowConversationType;
|
||||
openGiftBadge: (messageId: string) => void;
|
||||
pushPanelForConversation: PushPanelForConversationActionType;
|
||||
|
|
|
@ -9,8 +9,21 @@ import { MessageBody } from './MessageBody';
|
|||
import { setupI18n } from '../../util/setupI18n';
|
||||
import enMessages from '../../../_locales/en/messages.json';
|
||||
import { BodyRange } from '../../types/BodyRange';
|
||||
import { generateAci } from '../../types/ServiceId';
|
||||
import { RenderLocation } from './MessageTextRenderer';
|
||||
|
||||
const SERVICE_ID_1 = generateAci();
|
||||
const SERVICE_ID_2 = generateAci();
|
||||
const SERVICE_ID_3 = generateAci();
|
||||
const SERVICE_ID_4 = generateAci();
|
||||
const SERVICE_ID_5 = generateAci();
|
||||
const SERVICE_ID_6 = generateAci();
|
||||
const SERVICE_ID_7 = generateAci();
|
||||
const SERVICE_ID_8 = generateAci();
|
||||
const SERVICE_ID_9 = generateAci();
|
||||
const SERVICE_ID_10 = generateAci();
|
||||
const SERVICE_ID_11 = generateAci();
|
||||
|
||||
const i18n = setupI18n('en', enMessages);
|
||||
|
||||
export default {
|
||||
|
@ -115,7 +128,7 @@ export function Mention(): JSX.Element {
|
|||
{
|
||||
start: 5,
|
||||
length: 1,
|
||||
mentionUuid: 'tuv',
|
||||
mentionUuid: SERVICE_ID_1,
|
||||
replacementText: 'Bender B Rodriguez 🤖',
|
||||
conversationID: 'x',
|
||||
},
|
||||
|
@ -137,21 +150,21 @@ export function MultipleMentions(): JSX.Element {
|
|||
{
|
||||
start: 2,
|
||||
length: 1,
|
||||
mentionUuid: 'def',
|
||||
mentionUuid: SERVICE_ID_2,
|
||||
replacementText: 'Philip J Fry',
|
||||
conversationID: 'x',
|
||||
},
|
||||
{
|
||||
start: 4,
|
||||
length: 1,
|
||||
mentionUuid: 'abc',
|
||||
mentionUuid: SERVICE_ID_3,
|
||||
replacementText: 'Professor Farnsworth',
|
||||
conversationID: 'x',
|
||||
},
|
||||
{
|
||||
start: 0,
|
||||
length: 1,
|
||||
mentionUuid: 'xyz',
|
||||
mentionUuid: SERVICE_ID_4,
|
||||
replacementText: 'Yancy Fry',
|
||||
conversationID: 'x',
|
||||
},
|
||||
|
@ -179,21 +192,21 @@ export function ComplexMessageBody(): JSX.Element {
|
|||
{
|
||||
start: 78,
|
||||
length: 1,
|
||||
mentionUuid: 'wer',
|
||||
mentionUuid: SERVICE_ID_5,
|
||||
replacementText: 'Acid Burn',
|
||||
conversationID: 'x',
|
||||
},
|
||||
{
|
||||
start: 80,
|
||||
length: 1,
|
||||
mentionUuid: 'xox',
|
||||
mentionUuid: SERVICE_ID_6,
|
||||
replacementText: 'Cereal Killer',
|
||||
conversationID: 'x',
|
||||
},
|
||||
{
|
||||
start: 4,
|
||||
length: 1,
|
||||
mentionUuid: 'ldo',
|
||||
mentionUuid: SERVICE_ID_6,
|
||||
replacementText: 'Zero Cool',
|
||||
conversationID: 'x',
|
||||
},
|
||||
|
@ -311,14 +324,14 @@ export function FormattingSpoiler(): JSX.Element {
|
|||
{
|
||||
start: 54,
|
||||
length: 1,
|
||||
mentionUuid: 'a',
|
||||
mentionUuid: SERVICE_ID_7,
|
||||
conversationID: 'a',
|
||||
replacementText: '🅰️ Alice',
|
||||
},
|
||||
{
|
||||
start: 60,
|
||||
length: 1,
|
||||
mentionUuid: 'b',
|
||||
mentionUuid: SERVICE_ID_8,
|
||||
conversationID: 'b',
|
||||
replacementText: '🅱️ Bob',
|
||||
},
|
||||
|
@ -371,35 +384,35 @@ export function FormattingNesting(): JSX.Element {
|
|||
{
|
||||
start: 29,
|
||||
length: 1,
|
||||
mentionUuid: 'a',
|
||||
mentionUuid: SERVICE_ID_7,
|
||||
conversationID: 'a',
|
||||
replacementText: '🅰️ Alice',
|
||||
},
|
||||
{
|
||||
start: 61,
|
||||
length: 1,
|
||||
mentionUuid: 'b',
|
||||
mentionUuid: SERVICE_ID_8,
|
||||
conversationID: 'b',
|
||||
replacementText: '🅱️ Bob',
|
||||
},
|
||||
{
|
||||
start: 68,
|
||||
length: 1,
|
||||
mentionUuid: 'c',
|
||||
mentionUuid: SERVICE_ID_9,
|
||||
conversationID: 'c',
|
||||
replacementText: 'Charlie',
|
||||
},
|
||||
{
|
||||
start: 80,
|
||||
length: 1,
|
||||
mentionUuid: 'd',
|
||||
mentionUuid: SERVICE_ID_10,
|
||||
conversationID: 'd',
|
||||
replacementText: 'Dan',
|
||||
},
|
||||
{
|
||||
start: 105,
|
||||
length: 1,
|
||||
mentionUuid: 'e',
|
||||
mentionUuid: SERVICE_ID_11,
|
||||
conversationID: 'e',
|
||||
replacementText: 'Eve',
|
||||
},
|
||||
|
@ -439,7 +452,7 @@ export function FormattingComplex(): JSX.Element {
|
|||
{
|
||||
start: 24,
|
||||
length: 1,
|
||||
mentionUuid: 'abc',
|
||||
mentionUuid: SERVICE_ID_3,
|
||||
conversationID: 'x',
|
||||
replacementText: '🤖 Hello',
|
||||
},
|
||||
|
@ -471,7 +484,7 @@ export function FormattingComplex(): JSX.Element {
|
|||
{
|
||||
start: 491,
|
||||
length: 1,
|
||||
mentionUuid: 'abc',
|
||||
mentionUuid: SERVICE_ID_3,
|
||||
conversationID: 'x',
|
||||
replacementText: '🤖 Hello',
|
||||
},
|
||||
|
|
|
@ -11,6 +11,7 @@ import { setupI18n } from '../../util/setupI18n';
|
|||
import enMessages from '../../../_locales/en/messages.json';
|
||||
import type { HydratedBodyRangesType } from '../../types/BodyRange';
|
||||
import { BodyRange } from '../../types/BodyRange';
|
||||
import { generateAci } from '../../types/ServiceId';
|
||||
import { RenderLocation } from './MessageTextRenderer';
|
||||
|
||||
const i18n = setupI18n('en', enMessages);
|
||||
|
@ -91,7 +92,7 @@ export function LongTextWithMention(): JSX.Element {
|
|||
{
|
||||
start: 800,
|
||||
length: 1,
|
||||
mentionUuid: 'abc',
|
||||
mentionUuid: generateAci(),
|
||||
conversationID: 'x',
|
||||
replacementText: 'Alice',
|
||||
},
|
||||
|
|
|
@ -35,6 +35,7 @@ import { getDefaultConversation } from '../../test-both/helpers/getDefaultConver
|
|||
import { WidthBreakpoint } from '../_util';
|
||||
import { DAY, HOUR, MINUTE, SECOND } from '../../util/durations';
|
||||
import { ContactFormType } from '../../types/EmbeddedContact';
|
||||
import { generateAci } from '../../types/ServiceId';
|
||||
|
||||
import {
|
||||
fakeAttachment,
|
||||
|
@ -42,7 +43,6 @@ import {
|
|||
} from '../../test-both/helpers/fakeAttachment';
|
||||
import { getFakeBadge } from '../../test-both/helpers/getFakeBadge';
|
||||
import { ThemeType } from '../../types/Util';
|
||||
import { UUID } from '../../types/UUID';
|
||||
import { BadgeCategory } from '../../badges/BadgeCategory';
|
||||
import { PaymentEventKind } from '../../types/Payment';
|
||||
|
||||
|
@ -1676,7 +1676,7 @@ Mentions.args = {
|
|||
{
|
||||
start: 0,
|
||||
length: 1,
|
||||
mentionUuid: 'zap',
|
||||
mentionUuid: generateAci(),
|
||||
replacementText: 'Zapp Brannigan',
|
||||
conversationID: 'x',
|
||||
},
|
||||
|
@ -1944,7 +1944,7 @@ EmbeddedContactWithSendMessage.args = {
|
|||
contact: {
|
||||
...fullContact,
|
||||
firstNumber: fullContact.number[0].value,
|
||||
uuid: UUID.generate().toString(),
|
||||
uuid: generateAci(),
|
||||
},
|
||||
direction: 'incoming',
|
||||
};
|
||||
|
|
|
@ -19,7 +19,7 @@ import { ChooseGroupMembersModal } from './AddGroupMembersModal/ChooseGroupMembe
|
|||
import { ConfirmAdditionsModal } from './AddGroupMembersModal/ConfirmAdditionsModal';
|
||||
import { RequestState } from './util';
|
||||
import { ThemeType } from '../../../types/Util';
|
||||
import { makeFakeLookupConversationWithoutUuid } from '../../../test-both/helpers/fakeLookupConversationWithoutUuid';
|
||||
import { makeFakeLookupConversationWithoutServiceId } from '../../../test-both/helpers/fakeLookupConversationWithoutServiceId';
|
||||
|
||||
const i18n = setupI18n('en', enMessages);
|
||||
|
||||
|
@ -30,12 +30,11 @@ export default {
|
|||
const allCandidateContacts = times(50, () => getDefaultConversation());
|
||||
let allCandidateContactsLookup = makeLookup(allCandidateContacts, 'id');
|
||||
|
||||
const lookupConversationWithoutUuid = makeFakeLookupConversationWithoutUuid(
|
||||
convo => {
|
||||
const lookupConversationWithoutServiceId =
|
||||
makeFakeLookupConversationWithoutServiceId(convo => {
|
||||
allCandidateContacts.push(convo);
|
||||
allCandidateContactsLookup = makeLookup(allCandidateContacts, 'id');
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
type PropsType = ComponentProps<typeof AddGroupMembersModal>;
|
||||
|
||||
|
@ -68,7 +67,7 @@ const createProps = (
|
|||
getPreferredBadge={() => undefined}
|
||||
theme={ThemeType.light}
|
||||
i18n={i18n}
|
||||
lookupConversationWithoutUuid={lookupConversationWithoutUuid}
|
||||
lookupConversationWithoutServiceId={lookupConversationWithoutServiceId}
|
||||
showUserNotFoundModal={action('showUserNotFoundModal')}
|
||||
isUsernamesEnabled
|
||||
/>
|
||||
|
|
|
@ -17,7 +17,7 @@ import { strictAssert, assertDev } from '../../../../util/assert';
|
|||
import { refMerger } from '../../../../util/refMerger';
|
||||
import { useRestoreFocus } from '../../../../hooks/useRestoreFocus';
|
||||
import { missingCaseError } from '../../../../util/missingCaseError';
|
||||
import type { LookupConversationWithoutUuidActionsType } from '../../../../util/lookupConversationWithoutUuid';
|
||||
import type { LookupConversationWithoutServiceIdActionsType } from '../../../../util/lookupConversationWithoutServiceId';
|
||||
import { parseAndFormatPhoneNumber } from '../../../../util/libphonenumberInstance';
|
||||
import type { ParsedE164Type } from '../../../../util/libphonenumberInstance';
|
||||
import { filterAndSortConversationsByRecent } from '../../../../util/filterAndSortConversations';
|
||||
|
@ -65,13 +65,13 @@ export type StatePropsType = {
|
|||
toggleSelectedContact: (conversationId: string) => void;
|
||||
isUsernamesEnabled: boolean;
|
||||
} & Pick<
|
||||
LookupConversationWithoutUuidActionsType,
|
||||
'lookupConversationWithoutUuid'
|
||||
LookupConversationWithoutServiceIdActionsType,
|
||||
'lookupConversationWithoutServiceId'
|
||||
>;
|
||||
|
||||
type ActionPropsType = Omit<
|
||||
LookupConversationWithoutUuidActionsType,
|
||||
'setIsFetchingUUID' | 'lookupConversationWithoutUuid'
|
||||
LookupConversationWithoutServiceIdActionsType,
|
||||
'setIsFetchingUUID' | 'lookupConversationWithoutServiceId'
|
||||
>;
|
||||
|
||||
type PropsType = StatePropsType & ActionPropsType;
|
||||
|
@ -91,7 +91,7 @@ export function ChooseGroupMembersModal({
|
|||
setSearchTerm,
|
||||
theme,
|
||||
toggleSelectedContact,
|
||||
lookupConversationWithoutUuid,
|
||||
lookupConversationWithoutServiceId,
|
||||
showUserNotFoundModal,
|
||||
isUsernamesEnabled,
|
||||
}: PropsType): JSX.Element {
|
||||
|
@ -345,7 +345,9 @@ export function ChooseGroupMembersModal({
|
|||
}
|
||||
showUserNotFoundModal={showUserNotFoundModal}
|
||||
setIsFetchingUUID={setIsFetchingUUID}
|
||||
lookupConversationWithoutUuid={lookupConversationWithoutUuid}
|
||||
lookupConversationWithoutServiceId={
|
||||
lookupConversationWithoutServiceId
|
||||
}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
|
@ -353,7 +355,9 @@ export function ChooseGroupMembersModal({
|
|||
item = (
|
||||
<PhoneNumberCheckbox
|
||||
phoneNumber={row.phoneNumber}
|
||||
lookupConversationWithoutUuid={lookupConversationWithoutUuid}
|
||||
lookupConversationWithoutServiceId={
|
||||
lookupConversationWithoutServiceId
|
||||
}
|
||||
showUserNotFoundModal={showUserNotFoundModal}
|
||||
setIsFetchingUUID={setIsFetchingUUID}
|
||||
toggleConversationInChooseMembers={conversationId =>
|
||||
|
|
|
@ -14,7 +14,7 @@ import { ChooseGroupMembersModal } from './AddGroupMembersModal/ChooseGroupMembe
|
|||
import { ConfirmAdditionsModal } from './AddGroupMembersModal/ConfirmAdditionsModal';
|
||||
import type { ConversationType } from '../../../state/ducks/conversations';
|
||||
import { getDefaultConversation } from '../../../test-both/helpers/getDefaultConversation';
|
||||
import { makeFakeLookupConversationWithoutUuid } from '../../../test-both/helpers/fakeLookupConversationWithoutUuid';
|
||||
import { makeFakeLookupConversationWithoutServiceId } from '../../../test-both/helpers/fakeLookupConversationWithoutServiceId';
|
||||
import { ThemeType } from '../../../types/Util';
|
||||
import { DurationInSeconds } from '../../../util/durations';
|
||||
import { NavTab } from '../../../state/ducks/nav';
|
||||
|
@ -120,7 +120,7 @@ const createProps = (
|
|||
getPreferredBadge={() => undefined}
|
||||
theme={ThemeType.light}
|
||||
i18n={i18n}
|
||||
lookupConversationWithoutUuid={makeFakeLookupConversationWithoutUuid()}
|
||||
lookupConversationWithoutServiceId={makeFakeLookupConversationWithoutServiceId()}
|
||||
showUserNotFoundModal={action('showUserNotFoundModal')}
|
||||
isUsernamesEnabled
|
||||
/>
|
||||
|
|
|
@ -6,7 +6,7 @@ import { times } from 'lodash';
|
|||
|
||||
import { action } from '@storybook/addon-actions';
|
||||
|
||||
import { UUID } from '../../../types/UUID';
|
||||
import { generateAci } from '../../../types/ServiceId';
|
||||
import { StorySendMode } from '../../../types/Stories';
|
||||
import { setupI18n } from '../../../util/setupI18n';
|
||||
import enMessages from '../../../../_locales/en/messages.json';
|
||||
|
@ -45,7 +45,7 @@ const conversation: ConversationType = {
|
|||
storySendMode: StorySendMode.IfActive,
|
||||
};
|
||||
|
||||
const OUR_UUID = UUID.generate().toString();
|
||||
const OUR_UUID = generateAci();
|
||||
|
||||
const useProps = (overrideProps: Partial<PropsType> = {}): PropsType => ({
|
||||
approvePendingMembershipFromGroupV2: action(
|
||||
|
@ -54,7 +54,7 @@ const useProps = (overrideProps: Partial<PropsType> = {}): PropsType => ({
|
|||
conversation,
|
||||
getPreferredBadge: () => undefined,
|
||||
i18n,
|
||||
ourUuid: OUR_UUID,
|
||||
ourAci: OUR_UUID,
|
||||
pendingApprovalMemberships: times(5, () => ({
|
||||
member: getDefaultConversation(),
|
||||
})),
|
||||
|
@ -68,7 +68,7 @@ const useProps = (overrideProps: Partial<PropsType> = {}): PropsType => ({
|
|||
...times(8, () => ({
|
||||
member: getDefaultConversation(),
|
||||
metadata: {
|
||||
addedByUserId: UUID.generate().toString(),
|
||||
addedByUserId: generateAci(),
|
||||
},
|
||||
})),
|
||||
],
|
||||
|
|
|
@ -7,7 +7,7 @@ import _ from 'lodash';
|
|||
import type { ConversationType } from '../../../state/ducks/conversations';
|
||||
import type { LocalizerType, ThemeType } from '../../../types/Util';
|
||||
import type { PreferredBadgeSelectorType } from '../../../state/selectors/badges';
|
||||
import type { UUIDStringType } from '../../../types/UUID';
|
||||
import type { AciString } from '../../../types/ServiceId';
|
||||
import { Avatar, AvatarSize } from '../../Avatar';
|
||||
import { ConfirmationDialog } from '../../ConfirmationDialog';
|
||||
import { PanelSection } from './PanelSection';
|
||||
|
@ -21,7 +21,7 @@ export type PropsDataType = {
|
|||
readonly conversation?: ConversationType;
|
||||
readonly getPreferredBadge: PreferredBadgeSelectorType;
|
||||
readonly i18n: LocalizerType;
|
||||
readonly ourUuid: UUIDStringType;
|
||||
readonly ourAci: AciString;
|
||||
readonly pendingApprovalMemberships: ReadonlyArray<GroupV2RequestingMembership>;
|
||||
readonly pendingMemberships: ReadonlyArray<GroupV2PendingMembership>;
|
||||
readonly theme: ThemeType;
|
||||
|
@ -42,7 +42,7 @@ export type PropsType = PropsDataType & PropsActionType;
|
|||
|
||||
export type GroupV2PendingMembership = {
|
||||
metadata: {
|
||||
addedByUserId?: UUIDStringType;
|
||||
addedByUserId?: AciString;
|
||||
};
|
||||
member: ConversationType;
|
||||
};
|
||||
|
@ -72,16 +72,14 @@ export function PendingInvites({
|
|||
conversation,
|
||||
getPreferredBadge,
|
||||
i18n,
|
||||
ourUuid,
|
||||
ourAci,
|
||||
pendingMemberships,
|
||||
pendingApprovalMemberships,
|
||||
revokePendingMembershipsFromGroupV2,
|
||||
theme,
|
||||
}: PropsType): JSX.Element {
|
||||
if (!conversation || !ourUuid) {
|
||||
throw new Error(
|
||||
'PendingInvites rendered without a conversation or ourUuid'
|
||||
);
|
||||
if (!conversation || !ourAci) {
|
||||
throw new Error('PendingInvites rendered without a conversation or ourAci');
|
||||
}
|
||||
|
||||
const [stagedMemberships, setStagedMemberships] =
|
||||
|
@ -126,7 +124,7 @@ export function PendingInvites({
|
|||
i18n={i18n}
|
||||
members={conversation.sortedGroupMembers || []}
|
||||
memberships={pendingMemberships}
|
||||
ourUuid={ourUuid}
|
||||
ourAci={ourAci}
|
||||
setStagedMemberships={setStagedMemberships}
|
||||
theme={theme}
|
||||
/>
|
||||
|
@ -144,7 +142,7 @@ export function PendingInvites({
|
|||
i18n={i18n}
|
||||
members={conversation.sortedGroupMembers || []}
|
||||
onClose={() => setStagedMemberships(null)}
|
||||
ourUuid={ourUuid}
|
||||
ourAci={ourAci}
|
||||
revokePendingMembershipsFromGroupV2={
|
||||
revokePendingMembershipsFromGroupV2
|
||||
}
|
||||
|
@ -161,7 +159,7 @@ function MembershipActionConfirmation({
|
|||
i18n,
|
||||
members,
|
||||
onClose,
|
||||
ourUuid,
|
||||
ourAci,
|
||||
revokePendingMembershipsFromGroupV2,
|
||||
stagedMemberships,
|
||||
}: {
|
||||
|
@ -173,7 +171,7 @@ function MembershipActionConfirmation({
|
|||
i18n: LocalizerType;
|
||||
members: ReadonlyArray<ConversationType>;
|
||||
onClose: () => void;
|
||||
ourUuid: string;
|
||||
ourAci: AciString;
|
||||
revokePendingMembershipsFromGroupV2: (
|
||||
conversationId: string,
|
||||
memberIds: ReadonlyArray<string>
|
||||
|
@ -234,7 +232,7 @@ function MembershipActionConfirmation({
|
|||
conversation,
|
||||
i18n,
|
||||
members,
|
||||
ourUuid,
|
||||
ourAci,
|
||||
stagedMemberships,
|
||||
})}
|
||||
</ConfirmationDialog>
|
||||
|
@ -245,13 +243,13 @@ function getConfirmationMessage({
|
|||
conversation,
|
||||
i18n,
|
||||
members,
|
||||
ourUuid,
|
||||
ourAci,
|
||||
stagedMemberships,
|
||||
}: Readonly<{
|
||||
conversation: ConversationType;
|
||||
i18n: LocalizerType;
|
||||
members: ReadonlyArray<ConversationType>;
|
||||
ourUuid: string;
|
||||
ourAci: AciString;
|
||||
stagedMemberships: ReadonlyArray<StagedMembershipType>;
|
||||
}>): string {
|
||||
if (!stagedMemberships || !stagedMemberships.length) {
|
||||
|
@ -285,7 +283,7 @@ function getConfirmationMessage({
|
|||
const firstPendingMembership = firstMembership as GroupV2PendingMembership;
|
||||
|
||||
// Pending invite
|
||||
const invitedByUs = firstPendingMembership.metadata.addedByUserId === ourUuid;
|
||||
const invitedByUs = firstPendingMembership.metadata.addedByUserId === ourAci;
|
||||
|
||||
if (invitedByUs) {
|
||||
return i18n('icu:PendingInvites--revoke-for', {
|
||||
|
@ -391,7 +389,7 @@ function MembersPendingProfileKey({
|
|||
i18n,
|
||||
members,
|
||||
memberships,
|
||||
ourUuid,
|
||||
ourAci,
|
||||
setStagedMemberships,
|
||||
getPreferredBadge,
|
||||
theme,
|
||||
|
@ -401,7 +399,7 @@ function MembersPendingProfileKey({
|
|||
i18n: LocalizerType;
|
||||
members: ReadonlyArray<ConversationType>;
|
||||
memberships: ReadonlyArray<GroupV2PendingMembership>;
|
||||
ourUuid: string;
|
||||
ourAci: AciString;
|
||||
setStagedMemberships: (stagedMembership: Array<StagedMembershipType>) => void;
|
||||
theme: ThemeType;
|
||||
}>) {
|
||||
|
@ -410,7 +408,7 @@ function MembersPendingProfileKey({
|
|||
membership => membership.metadata.addedByUserId
|
||||
);
|
||||
|
||||
const { [ourUuid]: ourPendingMemberships, ...otherPendingMembershipGroups } =
|
||||
const { [ourAci]: ourPendingMemberships, ...otherPendingMembershipGroups } =
|
||||
groupedPendingMemberships;
|
||||
|
||||
const otherPendingMemberships = Object.keys(otherPendingMembershipGroups)
|
||||
|
|
|
@ -5,6 +5,7 @@ import type { ReactNode, FunctionComponent } from 'react';
|
|||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { isBoolean, isNumber } from 'lodash';
|
||||
import { v4 as generateUuid } from 'uuid';
|
||||
|
||||
import { Avatar, AvatarSize } from '../Avatar';
|
||||
import type { BadgeType } from '../../badges/types';
|
||||
|
@ -16,7 +17,6 @@ import { Spinner } from '../Spinner';
|
|||
import { Time } from '../Time';
|
||||
import { formatDateTimeShort } from '../../util/timestamp';
|
||||
import * as durations from '../../util/durations';
|
||||
import { UUID } from '../../types/UUID';
|
||||
|
||||
const BASE_CLASS_NAME =
|
||||
'module-conversation-list__item--contact-or-conversation';
|
||||
|
@ -113,7 +113,7 @@ export const BaseConversationListItem: FunctionComponent<PropsType> =
|
|||
} = props;
|
||||
|
||||
const identifier = id ? cleanId(id) : undefined;
|
||||
const htmlId = useMemo(() => UUID.generate().toString(), []);
|
||||
const htmlId = useMemo(() => generateUuid(), []);
|
||||
const testId = overrideTestId || groupId || uuid;
|
||||
const isUnread = isConversationUnread({ markedUnread, unreadCount });
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
import React from 'react';
|
||||
import type { ConversationType } from '../../state/ducks/conversations';
|
||||
import type { LocalizerType } from '../../types/Util';
|
||||
import type { UUIDStringType } from '../../types/UUID';
|
||||
import type { AciString } from '../../types/ServiceId';
|
||||
import { Avatar, AvatarSize } from '../Avatar';
|
||||
import { ListTile } from '../ListTile';
|
||||
import { UserText } from '../UserText';
|
||||
|
@ -21,7 +21,7 @@ export type GroupListItemConversationType = Pick<
|
|||
disabledReason: DisabledReason | undefined;
|
||||
membersCount: number;
|
||||
memberships: ReadonlyArray<{
|
||||
uuid: UUIDStringType;
|
||||
uuid: AciString;
|
||||
isAdmin: boolean;
|
||||
}>;
|
||||
};
|
||||
|
|
|
@ -13,6 +13,11 @@ import type { PropsType } from './MessageSearchResult';
|
|||
import { MessageSearchResult } from './MessageSearchResult';
|
||||
import { getDefaultConversation } from '../../test-both/helpers/getDefaultConversation';
|
||||
import { BodyRange } from '../../types/BodyRange';
|
||||
import { generateAci } from '../../types/ServiceId';
|
||||
|
||||
const SERVICE_ID_1 = generateAci();
|
||||
const SERVICE_ID_2 = generateAci();
|
||||
const SERVICE_ID_3 = generateAci();
|
||||
|
||||
const i18n = setupI18n('en', enMessages);
|
||||
|
||||
|
@ -198,14 +203,14 @@ export function Mention(): JSX.Element {
|
|||
bodyRanges: [
|
||||
{
|
||||
length: 1,
|
||||
mentionUuid: '7d007e95-771d-43ad-9191-eaa86c773cb8',
|
||||
mentionUuid: SERVICE_ID_3,
|
||||
replacementText: 'Shoe',
|
||||
conversationID: 'x',
|
||||
start: 113,
|
||||
},
|
||||
{
|
||||
length: 1,
|
||||
mentionUuid: '7d007e95-771d-43ad-9191-eaa86c773cb8',
|
||||
mentionUuid: SERVICE_ID_3,
|
||||
replacementText: 'Shoe',
|
||||
conversationID: 'x',
|
||||
start: 237,
|
||||
|
@ -230,7 +235,7 @@ export function MentionRegexp(): JSX.Element {
|
|||
bodyRanges: [
|
||||
{
|
||||
length: 1,
|
||||
mentionUuid: '7d007e95-771d-43ad-9191-eaa86c773cb8',
|
||||
mentionUuid: SERVICE_ID_3,
|
||||
replacementText: 'RegExp',
|
||||
conversationID: 'x',
|
||||
start: 0,
|
||||
|
@ -255,7 +260,7 @@ export function MentionNoMatches(): JSX.Element {
|
|||
bodyRanges: [
|
||||
{
|
||||
length: 1,
|
||||
mentionUuid: '7d007e95-771d-43ad-9191-eaa86c773cb8',
|
||||
mentionUuid: SERVICE_ID_3,
|
||||
replacementText: 'Neo',
|
||||
conversationID: 'x',
|
||||
start: 0,
|
||||
|
@ -279,14 +284,14 @@ export const _MentionNoMatches = (): JSX.Element => {
|
|||
bodyRanges: [
|
||||
{
|
||||
length: 1,
|
||||
mentionUuid: '7d007e95-771d-43ad-9191-eaa86c773cb8',
|
||||
mentionUuid: SERVICE_ID_3,
|
||||
replacementText: 'Shoe',
|
||||
conversationID: 'x',
|
||||
start: 113,
|
||||
},
|
||||
{
|
||||
length: 1,
|
||||
mentionUuid: '7d007e95-771d-43ad-9191-eaa86c773cb8',
|
||||
mentionUuid: SERVICE_ID_3,
|
||||
replacementText: 'Shoe',
|
||||
conversationID: 'x',
|
||||
start: 237,
|
||||
|
@ -311,14 +316,14 @@ export function DoubleMention(): JSX.Element {
|
|||
bodyRanges: [
|
||||
{
|
||||
length: 1,
|
||||
mentionUuid: '9eb2eb65-992a-4909-a2a5-18c56bd7648f',
|
||||
mentionUuid: SERVICE_ID_2,
|
||||
replacementText: 'Alice',
|
||||
conversationID: 'x',
|
||||
start: 4,
|
||||
},
|
||||
{
|
||||
length: 1,
|
||||
mentionUuid: '755ec61b-1590-48da-b003-3e57b2b54448',
|
||||
mentionUuid: SERVICE_ID_1,
|
||||
replacementText: 'Bob',
|
||||
conversationID: 'x',
|
||||
start: 6,
|
||||
|
|
|
@ -10,7 +10,7 @@ import { SPINNER_CLASS_NAME } from './BaseConversationListItem';
|
|||
import type { ParsedE164Type } from '../../util/libphonenumberInstance';
|
||||
import type { LocalizerType, ThemeType } from '../../types/Util';
|
||||
import { AvatarColors } from '../../types/Colors';
|
||||
import type { LookupConversationWithoutUuidActionsType } from '../../util/lookupConversationWithoutUuid';
|
||||
import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId';
|
||||
import { ListTile } from '../ListTile';
|
||||
import { Avatar, AvatarSize } from '../Avatar';
|
||||
import { Spinner } from '../Spinner';
|
||||
|
@ -26,7 +26,7 @@ type PropsHousekeepingType = {
|
|||
i18n: LocalizerType;
|
||||
theme: ThemeType;
|
||||
toggleConversationInChooseMembers: (conversationId: string) => void;
|
||||
} & LookupConversationWithoutUuidActionsType;
|
||||
} & LookupConversationWithoutServiceIdActionsType;
|
||||
|
||||
type PropsType = PropsDataType & PropsHousekeepingType;
|
||||
|
||||
|
@ -36,7 +36,7 @@ export const PhoneNumberCheckbox: FunctionComponent<PropsType> = React.memo(
|
|||
isChecked,
|
||||
isFetching,
|
||||
i18n,
|
||||
lookupConversationWithoutUuid,
|
||||
lookupConversationWithoutServiceId,
|
||||
showUserNotFoundModal,
|
||||
setIsFetchingUUID,
|
||||
toggleConversationInChooseMembers,
|
||||
|
@ -52,7 +52,7 @@ export const PhoneNumberCheckbox: FunctionComponent<PropsType> = React.memo(
|
|||
return;
|
||||
}
|
||||
|
||||
const conversationId = await lookupConversationWithoutUuid({
|
||||
const conversationId = await lookupConversationWithoutServiceId({
|
||||
showUserNotFoundModal,
|
||||
setIsFetchingUUID,
|
||||
|
||||
|
@ -67,7 +67,7 @@ export const PhoneNumberCheckbox: FunctionComponent<PropsType> = React.memo(
|
|||
}, [
|
||||
isFetching,
|
||||
toggleConversationInChooseMembers,
|
||||
lookupConversationWithoutUuid,
|
||||
lookupConversationWithoutServiceId,
|
||||
showUserNotFoundModal,
|
||||
setIsFetchingUUID,
|
||||
setIsModalVisible,
|
||||
|
|
|
@ -12,7 +12,7 @@ import { Avatar, AvatarSize } from '../Avatar';
|
|||
import { Spinner } from '../Spinner';
|
||||
|
||||
import type { ParsedE164Type } from '../../util/libphonenumberInstance';
|
||||
import type { LookupConversationWithoutUuidActionsType } from '../../util/lookupConversationWithoutUuid';
|
||||
import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId';
|
||||
import type { LocalizerType } from '../../types/Util';
|
||||
import type { ShowConversationType } from '../../state/ducks/conversations';
|
||||
import { AvatarColors } from '../../types/Colors';
|
||||
|
@ -25,7 +25,7 @@ type PropsData = {
|
|||
type PropsHousekeeping = {
|
||||
i18n: LocalizerType;
|
||||
showConversation: ShowConversationType;
|
||||
} & LookupConversationWithoutUuidActionsType;
|
||||
} & LookupConversationWithoutServiceIdActionsType;
|
||||
|
||||
export type Props = PropsData & PropsHousekeeping;
|
||||
|
||||
|
@ -34,7 +34,7 @@ export const StartNewConversation: FunctionComponent<Props> = React.memo(
|
|||
i18n,
|
||||
phoneNumber,
|
||||
isFetching,
|
||||
lookupConversationWithoutUuid,
|
||||
lookupConversationWithoutServiceId,
|
||||
showUserNotFoundModal,
|
||||
setIsFetchingUUID,
|
||||
showConversation,
|
||||
|
@ -49,7 +49,7 @@ export const StartNewConversation: FunctionComponent<Props> = React.memo(
|
|||
if (isFetching) {
|
||||
return;
|
||||
}
|
||||
const conversationId = await lookupConversationWithoutUuid({
|
||||
const conversationId = await lookupConversationWithoutServiceId({
|
||||
showUserNotFoundModal,
|
||||
setIsFetchingUUID,
|
||||
|
||||
|
@ -63,7 +63,7 @@ export const StartNewConversation: FunctionComponent<Props> = React.memo(
|
|||
}
|
||||
}, [
|
||||
showConversation,
|
||||
lookupConversationWithoutUuid,
|
||||
lookupConversationWithoutServiceId,
|
||||
showUserNotFoundModal,
|
||||
setIsFetchingUUID,
|
||||
setIsModalVisible,
|
||||
|
|
|
@ -6,7 +6,7 @@ import type { FunctionComponent } from 'react';
|
|||
|
||||
import type { LocalizerType, ThemeType } from '../../types/Util';
|
||||
import { AvatarColors } from '../../types/Colors';
|
||||
import type { LookupConversationWithoutUuidActionsType } from '../../util/lookupConversationWithoutUuid';
|
||||
import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId';
|
||||
import { ListTile } from '../ListTile';
|
||||
import { Avatar, AvatarSize } from '../Avatar';
|
||||
import { Spinner } from '../Spinner';
|
||||
|
@ -22,7 +22,7 @@ type PropsHousekeepingType = {
|
|||
i18n: LocalizerType;
|
||||
theme: ThemeType;
|
||||
toggleConversationInChooseMembers: (conversationId: string) => void;
|
||||
} & LookupConversationWithoutUuidActionsType;
|
||||
} & LookupConversationWithoutServiceIdActionsType;
|
||||
|
||||
type PropsType = PropsDataType & PropsHousekeepingType;
|
||||
|
||||
|
@ -32,7 +32,7 @@ export const UsernameCheckbox: FunctionComponent<PropsType> = React.memo(
|
|||
isChecked,
|
||||
isFetching,
|
||||
i18n,
|
||||
lookupConversationWithoutUuid,
|
||||
lookupConversationWithoutServiceId,
|
||||
showUserNotFoundModal,
|
||||
setIsFetchingUUID,
|
||||
toggleConversationInChooseMembers,
|
||||
|
@ -42,7 +42,7 @@ export const UsernameCheckbox: FunctionComponent<PropsType> = React.memo(
|
|||
return;
|
||||
}
|
||||
|
||||
const conversationId = await lookupConversationWithoutUuid({
|
||||
const conversationId = await lookupConversationWithoutServiceId({
|
||||
showUserNotFoundModal,
|
||||
setIsFetchingUUID,
|
||||
|
||||
|
@ -56,7 +56,7 @@ export const UsernameCheckbox: FunctionComponent<PropsType> = React.memo(
|
|||
}, [
|
||||
isFetching,
|
||||
toggleConversationInChooseMembers,
|
||||
lookupConversationWithoutUuid,
|
||||
lookupConversationWithoutServiceId,
|
||||
showUserNotFoundModal,
|
||||
setIsFetchingUUID,
|
||||
username,
|
||||
|
|
|
@ -9,7 +9,7 @@ import { Avatar, AvatarSize } from '../Avatar';
|
|||
import { Spinner } from '../Spinner';
|
||||
|
||||
import type { LocalizerType } from '../../types/Util';
|
||||
import type { LookupConversationWithoutUuidActionsType } from '../../util/lookupConversationWithoutUuid';
|
||||
import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId';
|
||||
import type { ShowConversationType } from '../../state/ducks/conversations';
|
||||
|
||||
type PropsData = {
|
||||
|
@ -20,14 +20,14 @@ type PropsData = {
|
|||
type PropsHousekeeping = {
|
||||
i18n: LocalizerType;
|
||||
showConversation: ShowConversationType;
|
||||
} & LookupConversationWithoutUuidActionsType;
|
||||
} & LookupConversationWithoutServiceIdActionsType;
|
||||
|
||||
export type Props = PropsData & PropsHousekeeping;
|
||||
|
||||
export function UsernameSearchResultListItem({
|
||||
i18n,
|
||||
isFetchingUsername,
|
||||
lookupConversationWithoutUuid,
|
||||
lookupConversationWithoutServiceId,
|
||||
username,
|
||||
showUserNotFoundModal,
|
||||
setIsFetchingUUID,
|
||||
|
@ -37,7 +37,7 @@ export function UsernameSearchResultListItem({
|
|||
if (isFetchingUsername) {
|
||||
return;
|
||||
}
|
||||
const conversationId = await lookupConversationWithoutUuid({
|
||||
const conversationId = await lookupConversationWithoutServiceId({
|
||||
showUserNotFoundModal,
|
||||
setIsFetchingUUID,
|
||||
|
||||
|
@ -50,7 +50,7 @@ export function UsernameSearchResultListItem({
|
|||
}
|
||||
}, [
|
||||
isFetchingUsername,
|
||||
lookupConversationWithoutUuid,
|
||||
lookupConversationWithoutServiceId,
|
||||
setIsFetchingUUID,
|
||||
showConversation,
|
||||
showUserNotFoundModal,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue