Skip to content

Commit

Permalink
fix: wrong validation of setting max share expiration to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
stonith404 committed Nov 3, 2023
1 parent 33742a0 commit acc35f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ const CreateUploadModalBody = ({
) as moment.unitOfTime.DurationConstructor,
);
if (
options.maxExpirationInHours != 0 &&
expirationDate.isAfter(
moment().add(options.maxExpirationInHours, "hours"),
)
Expand Down

0 comments on commit acc35f4

Please sign in to comment.