Skip to content

Commit

Permalink
fix: types for export3
Browse files Browse the repository at this point in the history
  • Loading branch information
diced committed Dec 16, 2024
1 parent 4d472a1 commit dcb4a4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default function Export3Details({ export3 }: { export3: Export3 }) {
const folderRows = Object.entries(export3.folders).map(([id, folder]) => (
<Table.Tr key={id}>
<Table.Td>{folder.name}</Table.Td>
<Table.Td>{findUser(export3, folder.user)?.username ?? 'unknown'}</Table.Td>
<Table.Td>{findUser(export3, folder?.user)?.username ?? 'unknown'}</Table.Td>
<Table.Td>{folder.public ? <IconCheck size='1rem' /> : <IconX size='1rem' />}</Table.Td>
<Table.Td>{new Date(folder.created_at).toLocaleString()}</Table.Td>
<Table.Td>{findFilesByUser(export3, id).length}</Table.Td>
Expand Down
4 changes: 3 additions & 1 deletion src/lib/import/version3/find.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Export3 } from './validateExport';

export function findUser(export3: Export3, id: string) {
export function findUser(export3: Export3, id: string | undefined | null) {
if (!id) return null;

return export3.users[id];
}

Expand Down

0 comments on commit dcb4a4e

Please sign in to comment.