Skip to content

Commit

Permalink
fix: correct display of translated key
Browse files Browse the repository at this point in the history
  • Loading branch information
MrQuackDuck committed Dec 30, 2024
1 parent 8595059 commit 7dad659
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/features/send-message/ui/ReplySection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CornerUpRightIcon, XCircleIcon } from "lucide-react";

import { MessageModel } from "@/entities/Message";
import { UserModel, Username } from "@/entities/User";
import { cn, decryptString } from "@/shared/lib";
import { cn, decryptString, useTranslation } from "@/shared/lib";

function ReplySection({
message,
Expand All @@ -19,6 +19,7 @@ function ReplySection({
decryptionKey: string;
onClicked: () => any;
}) {
const t = useTranslation();
const decryptedMessage = decryptString(message?.content ?? "", decryptionKey);

return (
Expand All @@ -31,7 +32,7 @@ function ReplySection({
<span className="overflow-hidden text-ellipsis whitespace-nowrap">
<span className="block flex-row overflow-hidden text-ellipsis whitespace-nowrap mr-1">
{decryptedMessage}
{decryptedMessage === undefined && <span className="text-destructive">{<>t("COULD_NOT_DECRYPT")</>}</span>}
{decryptedMessage === undefined && <span className="text-destructive">{t("COULD_NOT_DECRYPT")}</span>}
</span>
<div className="flex flex-row gap-1">
{message?.attachments.map((attachment) => (
Expand Down

0 comments on commit 7dad659

Please sign in to comment.