Update emails nav structure (#771)

This commit is contained in:
Leendert de Borst
2025-04-22 12:36:47 +02:00
parent 38b3b242d9
commit 4480eb897a
5 changed files with 28 additions and 11 deletions

View File

@@ -0,0 +1,27 @@
import { useColors } from '@/hooks/useColorScheme';
import { Stack } from 'expo-router';
export default function EmailsLayout() {
const colors = useColors();
return (
<Stack>
<Stack.Screen
name="index"
options={{
headerShown: false,
}}
/>
<Stack.Screen
name="[id]"
options={{
title: 'Email',
headerShown: true,
headerStyle: {
backgroundColor: colors.headerBackground,
},
}}
/>
</Stack>
);
}

View File

@@ -63,7 +63,7 @@ export default function TabLayout() {
}}
/>
<Tabs.Screen
name="emails"
name="(emails)"
options={{
title: 'Emails',
tabBarIcon: ({ color }) => <IconSymbol size={28} name="envelope.fill" color={color} />,

View File

@@ -92,9 +92,6 @@ class EncryptionUtility {
const ivHex = Buffer.from(iv).toString('hex');
const tagHex = Buffer.from(tag).toString('hex');
console.log('ivHex: ', ivHex);
console.log('tagHex: ', tagHex);
const decryptedData = await AesGcmCrypto.decrypt(
contentBase64,
base64Key,
@@ -253,21 +250,14 @@ class EncryptionUtility {
throw new Error('Encryption key not found');
}
console.log('email.encryptedSymmetricKey: ', email.encryptedSymmetricKey);
console.log('encryptionKey.PrivateKey: ', encryptionKey.PrivateKey);
// Decrypt symmetric key with asymmetric private key
const symmetricKey = await EncryptionUtility.decryptWithPrivateKey(
email.encryptedSymmetricKey,
encryptionKey.PrivateKey
);
console.log('Decrypted symmetricKey: ', symmetricKey);
const symmetricKeyBase64 = Buffer.from(symmetricKey).toString('base64');
console.log('Decrypted symmetricKeyBase64: ', symmetricKeyBase64);
// Create a new object to avoid mutating the original
const decryptedEmail = { ...email };