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(() => {