diff --git a/resources/js/lib/rule-engine.ts b/resources/js/lib/rule-engine.ts index 8598273b..7b4e0b9d 100644 --- a/resources/js/lib/rule-engine.ts +++ b/resources/js/lib/rule-engine.ts @@ -62,7 +62,8 @@ async function decryptAccountName( key: CryptoKey, ): Promise { try { - return await decrypt(account.name, key, account.name_iv); + const decryptedAccountName = await decrypt(account.name, key, account.name_iv); + return decryptedAccountName.trim(); } catch (error) { console.error('Failed to decrypt account name:', account.id, error); return ''; @@ -87,7 +88,6 @@ export async function prepareTransactionData( const category = transaction.category_id ? categories.find((c) => c.id === transaction.category_id) : null; - const accountName = account ? await decryptAccountName(account, encryptionKey) : '';