From 96440778a85cd5106959b7a779080ad90e6ccbdb Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 29 Apr 2022 23:15:47 +0800 Subject: ... --- FrontEnd/src/views/common/input/InputPanel.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'FrontEnd/src/views/common/input') diff --git a/FrontEnd/src/views/common/input/InputPanel.tsx b/FrontEnd/src/views/common/input/InputPanel.tsx index 704330eb..3ac0cb04 100644 --- a/FrontEnd/src/views/common/input/InputPanel.tsx +++ b/FrontEnd/src/views/common/input/InputPanel.tsx @@ -76,6 +76,14 @@ export type InputPanelError = { [index: number]: I18nText | null | undefined; }; +export function hasError(e: InputPanelError | null | undefined): boolean { + if (e == null) return false; + for (const key in e) { + if (e[key] != null) return true; + } + return false; +} + export interface InputPanelProps { scheme: InputList; values: MapInputListToValueTypeList; -- cgit v1.2.3