Skip to content

Commit

Permalink
feat: add a placeholder message for readonly 1:1 with a user without …
Browse files Browse the repository at this point in the history
…keys
  • Loading branch information
PatrykBuniX committed May 7, 2024
1 parent 96ff14c commit db972cf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,7 @@
"ongoingGroupVideoCall": "Ongoing video conference call with {{conversationName}}, your camera is {{cameraStatus}}.",
"ongoingVideoCall": "Ongoing video call with {{conversationName}}, your camera is {{cameraStatus}}.",
"otherUserNotSupportMLSMsg": "You can't communicate with {{participantName}} anymore, as you two now use different protocols. When {{participantName}} gets an update, you can call and send messages and files again.",
"otherUserNoAvailableKeyPackages": "This user has no available keys.",
"participantDevicesDetailHeadline": "Verify that this matches the fingerprint shown on [bold]{{user}}’s device[/bold].",
"participantDevicesDetailHowTo": "How do I do that?",
"participantDevicesDetailResetSession": "Reset session",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,14 @@ describe('ReadOnlyConversationMessage', () => {

expect(reloadAppMock).toHaveBeenCalled();
});

it("renders a conversation with a user that don't have any key pakages available", () => {
const conversation = generateConversation(CONVERSATION_READONLY_STATE.READONLY_ONE_TO_ONE_NO_KEY_PACKAGES, true);

const {getByText} = render(
withTheme(<ReadOnlyConversationMessage reloadApp={() => {}} conversation={conversation} />),
);

expect(getByText('otherUserNoAvailableKeyPackages')).toBeDefined();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ export const ReadOnlyConversationMessage: FC<ReadOnlyConversationMessageProps> =
</>
</ReadOnlyConversationMessageBase>
);
case CONVERSATION_READONLY_STATE.READONLY_ONE_TO_ONE_NO_KEY_PACKAGES:
return (
<ReadOnlyConversationMessageBase>
<span>{t('otherUserNoAvailableKeyPackages')}</span>
</ReadOnlyConversationMessageBase>
);
}
}

Expand Down

0 comments on commit db972cf

Please sign in to comment.