mirror of
https://github.com/stonith404/pingvin-share.git
synced 2025-01-15 01:14:27 -05:00
Add max files limit per share
This commit is contained in:
parent
4cf67db6a3
commit
7ddce593f9
3 changed files with 7 additions and 3 deletions
|
@ -65,7 +65,11 @@ const Dropzone = ({
|
|||
disabled={isUploading}
|
||||
openRef={openRef as ForwardedRef<() => void>}
|
||||
onDrop={(files) => {
|
||||
setFiles(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…
Add table
Reference in a new issue