From df9dcca62e8abac44698f6c97005148109eec6ba Mon Sep 17 00:00:00 2001 From: Ben Mitchinson Date: Thu, 9 Oct 2025 22:51:54 -0700 Subject: [PATCH] fix lint --- .../ActionButton/LocationSelector.tsx | 41 +++++++++++-------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/web/src/components/MemoEditor/ActionButton/LocationSelector.tsx b/web/src/components/MemoEditor/ActionButton/LocationSelector.tsx index fcc905a4c..f68c7c70f 100644 --- a/web/src/components/MemoEditor/ActionButton/LocationSelector.tsx +++ b/web/src/components/MemoEditor/ActionButton/LocationSelector.tsx @@ -35,23 +35,30 @@ const LocationSelector = (props: Props) => { const [popoverOpen, setPopoverOpen] = useState(false); useEffect(() => { - if (props.location) { - setState((state) => ({ - ...state, - placeholder: props.location.placeholder || "", - position: new LatLng(props.location.latitude, props.location.longitude), - latInput: String(props.location.latitude), - lngInput: String(props.location.longitude), - })); - } else { - setState((state) => ({ - ...state, - placeholder: "", - position: undefined, - latInput: "", - lngInput: "", - })); - } + setState((state) => ({ + ...state, + placeholder: props.location?.placeholder || "", + position: new LatLng(props.location?.latitude || 0, props.location?.longitude || 0), + latInput: String(props.location?.latitude) || "", + lngInput: String(props.location?.longitude) || "", + })); + // if (props.location) { + // setState((state) => ({ + // ...state, + // placeholder: props.location.placeholder || "", + // position: new LatLng(props.location.latitude, props.location.longitude), + // latInput: String(props.location.latitude), + // lngInput: String(props.location.longitude), + // })); + // } else { + // setState((state) => ({ + // ...state, + // placeholder: "", + // position: undefined, + // latInput: "", + // lngInput: "", + // })); + // } }, [props.location]); useEffect(() => {