diff options
| author | 2024-07-03 21:58:49 +0100 | |
|---|---|---|
| committer | 2024-07-03 21:58:49 +0100 | |
| commit | 0f28194810ff3d4873216ce8fb87e76d396ca375 (patch) | |
| tree | 33284a86cf38093fce148df28f62e575602ab9cd | |
| parent | Add additional logging for OAuth2 state mismatches (diff) | |
Add some debug logging to timezone autoselection
Diffstat (limited to '')
| -rw-r--r-- | src/components/InputTypes/TimeZone.tsx | 12 | 
1 files changed, 8 insertions, 4 deletions
diff --git a/src/components/InputTypes/TimeZone.tsx b/src/components/InputTypes/TimeZone.tsx index f944032..7b65961 100644 --- a/src/components/InputTypes/TimeZone.tsx +++ b/src/components/InputTypes/TimeZone.tsx @@ -56,9 +56,9 @@ const offsetToText = (offset: number) => {  };  interface TimeZoneProps { -  valid: boolean, -  question: React.RefObject<RenderedQuestion> -  onBlurHandler: () => void +    valid: boolean, +    question: React.RefObject<RenderedQuestion> +    onBlurHandler: () => void  }  const containerStyles = css` @@ -272,7 +272,11 @@ class TimeZone extends React.Component<TimeZoneProps> {          const tz = getTZ();          if (tz) { -            this.props.question.current?.setState({ value: tz }); +            if (!this.props.question.current) { +                console.warn("No ref to question component in TimeZone."); +            } else { +                this.props.question.current.setState({ value: tz }); +            }          }      }  |