diff --git a/frontend/src/features/vault/components/CategoryManager.tsx b/frontend/src/features/vault/components/CategoryManager.tsx index f94c162..dd67b3d 100644 --- a/frontend/src/features/vault/components/CategoryManager.tsx +++ b/frontend/src/features/vault/components/CategoryManager.tsx @@ -382,7 +382,7 @@ const CategoryManager: React.FC = () => { {/* Categories Grid/List */} {!isLoading && filteredCategories.length > 0 && (
- {filteredCategories.map((category) => ( + {(filteredCategories ?? []).map((category) => ( = ({ ) : (
- {newOrg.name ? newOrg.name.charAt(0).toUpperCase() : '?'} + {newOrg.name ? newOrg.name[0].toUpperCase() : '?'}
)} diff --git a/frontend/src/features/vault/components/OrganizationCard.tsx b/frontend/src/features/vault/components/OrganizationCard.tsx index 2b9d3dc..68a89b1 100644 --- a/frontend/src/features/vault/components/OrganizationCard.tsx +++ b/frontend/src/features/vault/components/OrganizationCard.tsx @@ -186,7 +186,7 @@ const OrganizationCard: React.FC = ({ org, onDelete, onEd // Fallback: First letter
- {org.name.charAt(0).toUpperCase()} + {org.name[0].toUpperCase()}
)} diff --git a/frontend/src/features/vault/components/VaultListItem.tsx b/frontend/src/features/vault/components/VaultListItem.tsx index 836d11e..bf2ec30 100644 --- a/frontend/src/features/vault/components/VaultListItem.tsx +++ b/frontend/src/features/vault/components/VaultListItem.tsx @@ -168,7 +168,7 @@ const VaultListItem: React.FC = ({ org, onClick, onEdit, onD ) : (
- {org.name.charAt(0).toUpperCase()} + {org.name[0].toUpperCase()}
)} diff --git a/frontend/src/features/vault/hooks/useExport.ts b/frontend/src/features/vault/hooks/useExport.ts index 6c294c0..4e19b88 100644 --- a/frontend/src/features/vault/hooks/useExport.ts +++ b/frontend/src/features/vault/hooks/useExport.ts @@ -148,7 +148,7 @@ export function useExport(): UseExportReturn { */ const exportVault = useCallback(async (password: string, format: ExportFormat) => { // Validate inputs - if (!password || password.trim() === '') { + if (!password || password.trim().length === 0) { setError('Password is required'); setPhase('ERROR'); return; @@ -225,7 +225,7 @@ export function useExport(): UseExportReturn { setProgressMessage(`Found ${orgIds.length} organizations...`); // Fetch all profiles from all organizations in parallel - const profilePromises = orgIds.map(orgId => + const profilePromises = (orgIds ?? []).map(orgId => apiClient.get(`/organizations/${orgId}/profiles/`) .then(res => ({ orgId, profiles: res.data })) .catch(() => ({ orgId, profiles: [] })) diff --git a/frontend/src/utils/encryption.ts b/frontend/src/utils/encryption.ts index 9cd0d47..f766aa7 100644 --- a/frontend/src/utils/encryption.ts +++ b/frontend/src/utils/encryption.ts @@ -128,7 +128,7 @@ export async function encryptData( plaintext: string, key: CryptoKey ): Promise<{ iv: string; ciphertext: string }> { - if (!plaintext || plaintext.trim() === '') { + if (!plaintext || plaintext.trim().length === 0) { throw new Error('Cannot encrypt empty data'); } @@ -269,7 +269,7 @@ export async function decryptCredentialFields( type IvKey = `${FieldName}_iv`; // Decrypt all fields in parallel for better performance - const decryptionPromises = fieldNames.map(async (fieldName) => { + const decryptionPromises = (fieldNames ?? []).map(async (fieldName) => { const encryptedKey = `${fieldName}_encrypted` as EncryptedKey; const ivKey = `${fieldName}_iv` as IvKey; const ciphertext = encryptedData[encryptedKey];