mirror of
https://github.com/stonith404/pingvin-share.git
synced 2024-11-04 23:10:13 +01:00
Add max files limit per share
This commit is contained in:
parent
4cf67db6a3
commit
7ddce593f9
@ -65,7 +65,11 @@ const Dropzone = ({
|
||||
disabled={isUploading}
|
||||
openRef={openRef as ForwardedRef<() => void>}
|
||||
onDrop={(files) => {
|
||||
if (files.length > 100) {
|
||||
toast.error("You can't upload more than 100 files per share.");
|
||||
} else {
|
||||
setFiles(files);
|
||||
}
|
||||
}}
|
||||
className={classes.dropzone}
|
||||
radius="md"
|
||||
|
@ -17,7 +17,7 @@ const FileList = ({
|
||||
};
|
||||
|
||||
const rows = files.map((file, i) => (
|
||||
<tr key={file.name}>
|
||||
<tr key={i}>
|
||||
<td>{file.name}</td>
|
||||
<td>{file.type}</td>
|
||||
<td>{bytesToSize(file.size)}</td>
|
||||
|
@ -20,7 +20,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
|
||||
addVisitorCount(shareId);
|
||||
|
||||
const fileListWithoutPreview = (await awServer.storage.listFiles(shareId))
|
||||
const fileListWithoutPreview = (await awServer.storage.listFiles(shareId, undefined, 100))
|
||||
.files;
|
||||
|
||||
for (const file of fileListWithoutPreview) {
|
||||
|
Loading…
Reference in New Issue
Block a user