From 2ad2c56b4c3edc6957e280debd7d1ba7a69fe5d1 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:05:34 -0700 Subject: [PATCH] Update custom-field-query.ts --- src-ui/src/app/data/custom-field-query.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src-ui/src/app/data/custom-field-query.ts b/src-ui/src/app/data/custom-field-query.ts index e70c5efb2..4869710d0 100644 --- a/src-ui/src/app/data/custom-field-query.ts +++ b/src-ui/src/app/data/custom-field-query.ts @@ -189,10 +189,9 @@ export class CustomFieldQueryAtom extends CustomFieldQueryElement { } override set operator(operator: string) { - if ( - typeof this.value !== CUSTOM_FIELD_QUERY_VALUE_TYPES_BY_OPERATOR[operator] - ) { - switch (CUSTOM_FIELD_QUERY_VALUE_TYPES_BY_OPERATOR[operator]) { + const newType: string = CUSTOM_FIELD_QUERY_VALUE_TYPES_BY_OPERATOR[operator] + if (typeof this.value !== newType) { + switch (newType) { case 'string': this.value = '' break @@ -204,6 +203,11 @@ export class CustomFieldQueryAtom extends CustomFieldQueryElement { this.value = null break } + } else if ( + ['true', 'false'].includes(this.value as string) && + newType === 'string' + ) { + this.value = '' } super.operator = operator }