Fix context menu translations which prevented clickhandler from working (#520)

This commit is contained in:
Leendert de Borst
2025-10-17 13:55:48 +02:00
parent efaa7962cb
commit 37acd87c44
2 changed files with 14 additions and 9 deletions

View File

@@ -83,15 +83,17 @@ export function CredentialCard({ credential, onCredentialDelete }: CredentialCar
const handleContextMenuAction = async (event: OnPressMenuItemEvent): Promise<void> => {
const { name } = event.nativeEvent;
console.log('handleContextMenuAction', name);
switch (name) {
case 'Edit':
case t('credentials.contextMenu.edit'):
Keyboard.dismiss();
router.push({
pathname: '/(tabs)/credentials/add-edit',
params: { id: credential.Id }
});
break;
case 'Delete':
case t('credentials.contextMenu.delete'):
Keyboard.dismiss();
Alert.alert(
t('credentials.deleteCredential'),
@@ -116,37 +118,37 @@ export function CredentialCard({ credential, onCredentialDelete }: CredentialCar
]
);
break;
case 'Copy Username':
case t('credentials.contextMenu.copyUsername'):
if (credential.Username) {
await copyToClipboard(credential.Username);
if (Platform.OS === 'ios') {
Toast.show({
type: 'success',
text1: 'Username copied to clipboard',
text1: t('credentials.toasts.usernameCopied'),
position: 'bottom',
});
}
}
break;
case 'Copy Email':
case t('credentials.contextMenu.copyEmail'):
if (credential.Alias?.Email) {
await copyToClipboard(credential.Alias.Email);
if (Platform.OS === 'ios') {
Toast.show({
type: 'success',
text1: 'Email copied to clipboard',
text1: t('credentials.toasts.emailCopied'),
position: 'bottom',
});
}
}
break;
case 'Copy Password':
case t('credentials.contextMenu.copyPassword'):
if (credential.Password) {
await copyToClipboard(credential.Password);
if (Platform.OS === 'ios') {
Toast.show({
type: 'success',
text1: 'Password copied to clipboard',
text1: t('credentials.toasts.passwordCopied'),
position: 'bottom',
});
}

View File

@@ -167,7 +167,10 @@
"toasts": {
"credentialUpdated": "Credential updated successfully",
"credentialCreated": "Credential created successfully",
"credentialDeleted": "Credential deleted successfully"
"credentialDeleted": "Credential deleted successfully",
"usernameCopied": "Username copied to clipboard",
"emailCopied": "Email copied to clipboard",
"passwordCopied": "Password copied to clipboard"
},
"createNewAliasFor": "Create new alias for",
"errors": {