diff --git a/gui/src/components/input/QueryList.tsx b/gui/src/components/input/QueryList.tsx index 949b176e..f4f75035 100644 --- a/gui/src/components/input/QueryList.tsx +++ b/gui/src/components/input/QueryList.tsx @@ -40,6 +40,14 @@ export function QueryList(props: QueryListProps) { const { labels, query, value } = props; const { result } = query; + function firstValidValue(): string { + if (doesExist(value) && data.includes(value)) { + return value; + } else { + return data[0]; + } + } + if (result.status === 'error') { if (result.error instanceof Error) { return Error: {result.error.message}; @@ -65,7 +73,7 @@ export function QueryList(props: QueryListProps) {