fix: error on admin share management page if a share was created by an anonymous user
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user