From ed0f49656dce2df66406b4b04ab9a292eaea32dc Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Thu, 7 Aug 2025 02:42:53 +0000 Subject: [PATCH] Simplify contactsToExportJson function Remove unnecessary contact object mapping in contactsToExportJson function. The contacts array can be used directly since it already contains all required fields in the correct format. --- src/libs/util.ts | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/libs/util.ts b/src/libs/util.ts index ea8cbab0..62746195 100644 --- a/src/libs/util.ts +++ b/src/libs/util.ts @@ -900,30 +900,12 @@ export interface DatabaseExport { * @returns DatabaseExport object in the standardized format */ export const contactsToExportJson = (contacts: Contact[]): DatabaseExport => { - // Convert each contact to a plain object and ensure all fields are included - const rows = contacts.map((contact) => { - // Create a plain object without stringifying contactMethods - const exContact = { - did: contact.did, - iViewContent: contact.iViewContent, - name: contact.name, - nextPubKeyHashB64: contact.nextPubKeyHashB64, - notes: contact.notes, - profileImageUrl: contact.profileImageUrl, - publicKeyBase64: contact.publicKeyBase64, - seesMe: contact.seesMe, - registered: contact.registered, - contactMethods: contact.contactMethods || [], - }; - return exContact; - }); - return { data: { data: [ { tableName: "contacts", - rows, + rows: contacts, }, ], },