feat: ability to limit the max expiration of a share

This commit is contained in:
Elias Schneider
2023-10-23 15:17:47 +02:00
parent 46b6e56c06
commit bbfc9d6f14
9 changed files with 152 additions and 57 deletions

View File

@@ -77,6 +77,7 @@ const MyShares = () => {
showCreateReverseShareModal(
modals,
config.get("smtp.enabled"),
config.get("share.maxExpiration"),
getReverseShares,
)
}

View File

@@ -42,7 +42,14 @@ const Upload = ({
const uploadFiles = async (share: CreateShare, files: FileUpload[]) => {
setisUploading(true);
createdShare = await shareService.create(share);
try {
createdShare = await shareService.create(share);
} catch (e) {
toast.axiosError(e);
setisUploading(false);
return;
}
const fileUploadPromises = files.map(async (file, fileIndex) =>
// Limit the number of concurrent uploads to 3
@@ -132,6 +139,7 @@ const Upload = ({
"share.allowUnauthenticatedShares",
),
enableEmailRecepients: config.get("email.enableShareEmailRecipients"),
maxExpirationInHours: config.get("share.maxExpiration"),
},
files,
uploadFiles,