From 4ddcb7c3bad4e98d05d25298f7f11353a639b360 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 18 Nov 2020 16:25:37 +0100 Subject: Fix video tag validator --- client/src/app/shared/form-validators/video-validators.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'client/src/app/shared/form-validators') diff --git a/client/src/app/shared/form-validators/video-validators.ts b/client/src/app/shared/form-validators/video-validators.ts index 23f2391b2..b3ce876b1 100644 --- a/client/src/app/shared/form-validators/video-validators.ts +++ b/client/src/app/shared/form-validators/video-validators.ts @@ -64,7 +64,7 @@ export const VIDEO_TAGS_ARRAY_VALIDATOR: BuildFormValidator = { VALIDATORS: [ Validators.maxLength(5), arrayTagLengthValidator() ], MESSAGES: { 'maxlength': $localize`A maximum of 5 tags can be used on a video.`, - 'arrayTagLength': $localize`A tag should be more than 2, and less than 30 characters long.` + 'arrayTagLength': $localize`A tag should be more than 1 and less than 30 characters long.` } } @@ -92,7 +92,7 @@ function arrayTagLengthValidator (min = 2, max = 30): ValidatorFn { return (control: AbstractControl): ValidationErrors => { const array = control.value as Array - if (array.every(e => e.length > min && e.length < max)) { + if (array.every(e => e.length >= min && e.length <= max)) { return null } -- cgit v1.2.3