web: fix direct index access of strings

This commit is contained in:
Abdullah Atta
2024-11-27 13:14:44 +05:00
parent 94e4b00294
commit c19635b16a
3 changed files with 24 additions and 5 deletions

View File

@@ -480,9 +480,7 @@ export const AddReminderDialog = DialogManager.register(
checked={p.id === priority}
onChange={() => setPriority(p.id)}
/>
{strings.reminderNotificationModes[
p.title as keyof typeof strings.reminderNotificationModes
]()}
{strings.reminderNotificationModes(p.title)}
</Label>
))}
</Flex>

View File

@@ -130,7 +130,7 @@ export function BillingHistory() {
{transaction.amount} {transaction.currency}
</Text>
<Text as="td" variant="body">
{strings.transactionStatusToText[transaction.status]()}
{strings.transactionStatusToText(transaction.status)}
</Text>
<Text as="td" variant="body">
<Link

View File

@@ -232,10 +232,31 @@ type RecoveryMethod = {
isDangerous?: boolean;
};
const recoveryMethods: RecoveryMethod[] = [
{
type: "key",
testId: "step-recovery-key",
title: () => strings.recoveryKeyMethod(),
description: () => strings.recoveryKeyMethodDesc()
},
{
type: "backup",
testId: "step-backup",
title: () => strings.backupFileMethod(),
description: () => strings.backupFileMethodDesc()
},
{
type: "reset",
testId: "step-reset-account",
title: () => strings.clearDataAndResetMethod(),
description: () => strings.clearDataAndResetMethodDesc(),
isDangerous: true
}
];
function RecoveryMethods(props: BaseRecoveryComponentProps<"methods">) {
const { navigate } = props;
const [selected, setSelected] = useState(0);
const recoveryMethods = strings.accountRecoveryMethods as RecoveryMethod[];
if (isSessionExpired()) {
navigate("new");