mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
Merge pull request #593 from msgmaxim/not-friends
Fix incorrectly showing friend request as pending
This commit is contained in:
commit
6c08852118
|
@ -2067,5 +2067,13 @@
|
|||
"friendsTab": {
|
||||
"message": "Friends",
|
||||
"description": "friend tab title"
|
||||
},
|
||||
"pending": {
|
||||
"message": "pending",
|
||||
"description": "Indicates that a friend request is pending"
|
||||
},
|
||||
"notFriends": {
|
||||
"message": "not friends",
|
||||
"description": "Indicates that a conversation is not friends with us"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -203,9 +203,9 @@
|
|||
profileName: this.model.getProfileName(),
|
||||
color: this.model.getColor(),
|
||||
avatarPath: this.model.getAvatarPath(),
|
||||
|
||||
isVerified: this.model.isVerified(),
|
||||
isKeysPending: !this.model.isFriend(),
|
||||
isFriendRequestPending: this.model.isPendingFriendRequest(),
|
||||
isFriend: this.model.isFriend(),
|
||||
isMe: this.model.isMe(),
|
||||
isClosable: this.model.isClosable(),
|
||||
isBlocked: this.model.isBlocked(),
|
||||
|
|
|
@ -1432,6 +1432,11 @@
|
|||
height: 48px;
|
||||
}
|
||||
|
||||
.module-conversation-header__title-text {
|
||||
color: darkgrey;
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
.module-conversation-header__title-flex {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
|
|
|
@ -37,7 +37,8 @@ interface Props {
|
|||
hasNickname?: boolean;
|
||||
|
||||
isBlocked: boolean;
|
||||
isKeysPending: boolean;
|
||||
isFriend: boolean;
|
||||
isFriendRequestPending: boolean;
|
||||
isOnline?: boolean;
|
||||
|
||||
onSetDisappearingMessages: (seconds: number) => void;
|
||||
|
@ -102,7 +103,9 @@ export class ConversationHeader extends React.Component<Props> {
|
|||
phoneNumber,
|
||||
i18n,
|
||||
profileName,
|
||||
isKeysPending,
|
||||
isFriend,
|
||||
isGroup,
|
||||
isFriendRequestPending,
|
||||
isMe,
|
||||
name,
|
||||
} = this.props;
|
||||
|
@ -115,6 +118,18 @@ export class ConversationHeader extends React.Component<Props> {
|
|||
);
|
||||
}
|
||||
|
||||
let text = '';
|
||||
if (isFriendRequestPending) {
|
||||
text = `(${i18n('pending')})`;
|
||||
} else if (!isFriend && !isGroup) {
|
||||
text = `(${i18n('notFriends')})`;
|
||||
}
|
||||
|
||||
const textEl =
|
||||
text === '' ? null : (
|
||||
<span className="module-conversation-header__title-text">{text}</span>
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="module-conversation-header__title">
|
||||
<ContactName
|
||||
|
@ -123,7 +138,7 @@ export class ConversationHeader extends React.Component<Props> {
|
|||
name={name}
|
||||
i18n={i18n}
|
||||
/>
|
||||
{isKeysPending ? '(pending)' : null}
|
||||
{textEl}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue