Fix rendering of group joins and remove checkServiceIdEquivalence
This commit is contained in:
parent
214fae0c6e
commit
a1f0afdae8
12 changed files with 108 additions and 65 deletions
|
@ -50,13 +50,6 @@ const renderContact: SmartContactRendererType<JSX.Element> = (
|
|||
</React.Fragment>
|
||||
);
|
||||
|
||||
function checkServiceIdEquivalence(
|
||||
left: ServiceIdString | undefined,
|
||||
right: ServiceIdString | undefined
|
||||
): boolean {
|
||||
return Boolean(left && right && contactMap[left] === contactMap[right]);
|
||||
}
|
||||
|
||||
const renderChange = (
|
||||
change: GroupV2ChangeType,
|
||||
{
|
||||
|
@ -79,7 +72,6 @@ const renderChange = (
|
|||
blockGroupLinkRequests={action('blockGroupLinkRequests')}
|
||||
conversationId="some-conversation-id"
|
||||
change={change}
|
||||
checkServiceIdEquivalence={checkServiceIdEquivalence}
|
||||
groupBannedMemberships={groupBannedMemberships}
|
||||
groupMemberships={groupMemberships}
|
||||
groupName={groupName}
|
||||
|
@ -615,7 +607,39 @@ export function MemberAddFromInvited(): JSX.Element {
|
|||
},
|
||||
],
|
||||
})}
|
||||
ACI accepts PNI invite:
|
||||
ACI accepts PNI invite (X joined the group)
|
||||
{renderChange({
|
||||
from: OUR_PNI,
|
||||
details: [
|
||||
{
|
||||
type: 'member-add-from-invite',
|
||||
aci: OUR_ACI,
|
||||
pni: OUR_PNI,
|
||||
inviter: CONTACT_B,
|
||||
},
|
||||
],
|
||||
})}
|
||||
{renderChange({
|
||||
from: OUR_PNI,
|
||||
details: [
|
||||
{
|
||||
type: 'member-add-from-invite',
|
||||
aci: OUR_ACI,
|
||||
pni: OUR_PNI,
|
||||
},
|
||||
],
|
||||
})}
|
||||
{renderChange({
|
||||
from: CONTACT_A_PNI,
|
||||
details: [
|
||||
{
|
||||
type: 'member-add-from-invite',
|
||||
aci: CONTACT_A,
|
||||
pni: CONTACT_A_PNI,
|
||||
},
|
||||
],
|
||||
})}
|
||||
ACI accepts PNI invite, the old way (X added X to group)
|
||||
{renderChange({
|
||||
from: OUR_PNI,
|
||||
details: [
|
||||
|
|
|
@ -49,10 +49,6 @@ export type PropsActionsType = {
|
|||
};
|
||||
|
||||
export type PropsHousekeepingType = {
|
||||
checkServiceIdEquivalence(
|
||||
left: ServiceIdString | undefined,
|
||||
right: ServiceIdString | undefined
|
||||
): boolean;
|
||||
i18n: LocalizerType;
|
||||
renderContact: SmartContactRendererType<JSX.Element>;
|
||||
};
|
||||
|
@ -297,7 +293,6 @@ export function GroupV2Change(props: PropsType): ReactElement {
|
|||
areWeAdmin,
|
||||
blockGroupLinkRequests,
|
||||
change,
|
||||
checkServiceIdEquivalence,
|
||||
conversationId,
|
||||
groupBannedMemberships,
|
||||
groupMemberships,
|
||||
|
@ -311,7 +306,6 @@ export function GroupV2Change(props: PropsType): ReactElement {
|
|||
return (
|
||||
<>
|
||||
{renderChange<JSX.Element>(change, {
|
||||
checkServiceIdEquivalence,
|
||||
i18n,
|
||||
ourAci,
|
||||
ourPni,
|
||||
|
|
|
@ -361,7 +361,6 @@ const renderItem = ({
|
|||
isNextItemCallingNotification={false}
|
||||
theme={ThemeType.light}
|
||||
platform="darwin"
|
||||
checkServiceIdEquivalence={() => false}
|
||||
containerElementRef={containerElementRef}
|
||||
containerWidthBreakpoint={containerWidthBreakpoint}
|
||||
conversationId=""
|
||||
|
|
|
@ -69,7 +69,6 @@ const getDefaultProps = () => ({
|
|||
toggleSelectMessage: action('toggleSelectMessage'),
|
||||
reactToMessage: action('reactToMessage'),
|
||||
checkForAccount: action('checkForAccount'),
|
||||
checkServiceIdEquivalence: () => false,
|
||||
clearTargetedMessage: action('clearTargetedMessage'),
|
||||
setMessageToEdit: action('setMessageToEdit'),
|
||||
setQuoteByMessageId: action('setQuoteByMessageId'),
|
||||
|
|
|
@ -61,7 +61,6 @@ import {
|
|||
type MessageRequestResponseNotificationData,
|
||||
} from './MessageRequestResponseNotification';
|
||||
import type { MessageRequestState } from './MessageRequestActionsConfirmation';
|
||||
import type { ServiceIdString } from '../../types/ServiceId';
|
||||
|
||||
type CallHistoryType = {
|
||||
type: 'callHistory';
|
||||
|
@ -173,10 +172,6 @@ export type TimelineItemType = (
|
|||
) & { timestamp: number };
|
||||
|
||||
type PropsLocalType = {
|
||||
checkServiceIdEquivalence(
|
||||
left: ServiceIdString | undefined,
|
||||
right: ServiceIdString | undefined
|
||||
): boolean;
|
||||
containerElementRef: RefObject<HTMLElement>;
|
||||
conversationId: string;
|
||||
item?: TimelineItemType;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue