mirror of
https://github.com/stonith404/pingvin-share.git
synced 2024-11-16 12:20:13 +01:00
fix: wrong validation of setting max share expiration to 0
This commit is contained in:
parent
33742a043d
commit
acc35f4717
@ -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", {
|
||||
|
@ -126,6 +126,7 @@ const CreateUploadModalBody = ({
|
||||
) as moment.unitOfTime.DurationConstructor,
|
||||
);
|
||||
if (
|
||||
options.maxExpirationInHours != 0 &&
|
||||
expirationDate.isAfter(
|
||||
moment().add(options.maxExpirationInHours, "hours"),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user