diff --git a/frontend/src/components/share/modals/showCreateReverseShareModal.tsx b/frontend/src/components/share/modals/showCreateReverseShareModal.tsx index 46be7c40..027848cf 100644 --- a/frontend/src/components/share/modals/showCreateReverseShareModal.tsx +++ b/frontend/src/components/share/modals/showCreateReverseShareModal.tsx @@ -72,7 +72,10 @@ const Body = ({ "", ) as moment.unitOfTime.DurationConstructor, ); - if (expirationDate.isAfter(moment().add(maxExpirationInHours, "hours"))) { + if ( + maxExpirationInHours != 0 && + expirationDate.isAfter(moment().add(maxExpirationInHours, "hours")) + ) { form.setFieldError( "expiration_num", t("upload.modal.expires.error.too-long", { diff --git a/frontend/src/components/upload/modals/showCreateUploadModal.tsx b/frontend/src/components/upload/modals/showCreateUploadModal.tsx index e9a3aeff..72490c96 100644 --- a/frontend/src/components/upload/modals/showCreateUploadModal.tsx +++ b/frontend/src/components/upload/modals/showCreateUploadModal.tsx @@ -126,6 +126,7 @@ const CreateUploadModalBody = ({ ) as moment.unitOfTime.DurationConstructor, ); if ( + options.maxExpirationInHours != 0 && expirationDate.isAfter( moment().add(options.maxExpirationInHours, "hours"), )