mirror of
https://github.com/stonith404/pingvin-share.git
synced 2025-01-15 01:14:27 -05:00
fix: error on admin share management page if a share was created by an anonymous user
This commit is contained in:
parent
908d6e298f
commit
c999df15e0
2 changed files with 9 additions and 2 deletions
|
@ -5,6 +5,7 @@ import {
|
||||||
MediaQuery,
|
MediaQuery,
|
||||||
Skeleton,
|
Skeleton,
|
||||||
Table,
|
Table,
|
||||||
|
Text,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useClipboard } from "@mantine/hooks";
|
import { useClipboard } from "@mantine/hooks";
|
||||||
import { useModals } from "@mantine/modals";
|
import { useModals } from "@mantine/modals";
|
||||||
|
@ -65,7 +66,13 @@ const ManageShareTable = ({
|
||||||
<tr key={share.id}>
|
<tr key={share.id}>
|
||||||
<td>{share.id}</td>
|
<td>{share.id}</td>
|
||||||
<td>{share.name}</td>
|
<td>{share.name}</td>
|
||||||
<td>{share.creator.username}</td>
|
<td>
|
||||||
|
{share.creator ? (
|
||||||
|
share.creator.username
|
||||||
|
) : (
|
||||||
|
<Text color="dimmed">Anonymous</Text>
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
<td>{share.views}</td>
|
<td>{share.views}</td>
|
||||||
<td>{byteToHumanSizeString(share.size)}</td>
|
<td>{byteToHumanSizeString(share.size)}</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
|
@ -4,7 +4,7 @@ export type Share = {
|
||||||
id: string;
|
id: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
files: any;
|
files: any;
|
||||||
creator: User;
|
creator?: User;
|
||||||
description?: string;
|
description?: string;
|
||||||
expiration: Date;
|
expiration: Date;
|
||||||
size: number;
|
size: number;
|
||||||
|
|
Loading…
Add table
Reference in a new issue