diff --git a/frontend/src/components/share/modals/showCreateReverseShareModal.tsx b/frontend/src/components/share/modals/showCreateReverseShareModal.tsx index 46be7c408..027848cfa 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 e9a3aefff..72490c964 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"), )