mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-05-18 13:28:12 -04:00
Fix context menu translations which prevented clickhandler from working (#520)
This commit is contained in:
@@ -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',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user