Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Add support for multiple URLs to AliasVault CSV export and import in mobile app (#2308)

Leendert de Borst5703ced8a31f
diff --git a/apps/mobile-app/app/(tabs)/settings/import-export.tsx b/apps/mobile-app/app/(tabs)/settings/import-export.tsx
index 86ecb84f1..09e797886 100644
--- a/apps/mobile-app/app/(tabs)/settings/import-export.tsx
+++ b/apps/mobile-app/app/(tabs)/settings/import-export.tsx
@@ -5,7 +5,7 @@ import { useState } from 'react';
import { StyleSheet, View, TouchableOpacity } from 'react-native';
import type { Item } from '@/utils/dist/core/models/vault';
-import { getFieldValue } from '@/utils/dist/core/models/vault';
+import { getFieldValue, getFieldValues } from '@/utils/dist/core/models/vault';
import { VaultUnlockHelper } from '@/utils/VaultUnlockHelper';
import { useColors } from '@/hooks/useColorScheme';
@@ -102,6 +102,16 @@ export default function ImportExportScreen(): React.ReactNode {
return value ?? '';
};
+ /**
+ * Helper to extract all values of a multi-value field as a comma separated string.
+ */
+ const getFieldValuesAsString = (item: Item, fieldKey: string): string => {
+ return getFieldValues(item, fieldKey)
+ .map(value => value?.trim() ?? '')
+ .filter(value => value.length > 0)
+ .join(',');
+ };
+
/**
* Convert items to CSV format.
* Matches the server's ItemCsvService.ExportItemsToCsv format.
@@ -124,7 +134,7 @@ export default function ImportExportScreen(): React.ReactNode {
const folderPath = item.FolderPath?.join('/') ?? '';
// Get field values using the same FieldKey constants as server
- const serviceUrl = getFieldValueAsString(item, 'login.url');
+ const serviceUrl = getFieldValuesAsString(item, 'login.url');
const username = getFieldValueAsString(item, 'login.username');
const password = getFieldValueAsString(item, 'login.password');
const aliasEmail = getFieldValueAsString(item, 'login.email');