mirror of https://github.com/usememos/memos.git
fix lint
This commit is contained in:
parent
79b31ac634
commit
df9dcca62e
|
|
@ -35,23 +35,30 @@ const LocationSelector = (props: Props) => {
|
|||
const [popoverOpen, setPopoverOpen] = useState<boolean>(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),
|
||||
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) || "",
|
||||
}));
|
||||
} else {
|
||||
setState((state) => ({
|
||||
...state,
|
||||
placeholder: "",
|
||||
position: undefined,
|
||||
latInput: "",
|
||||
lngInput: "",
|
||||
}));
|
||||
}
|
||||
// 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(() => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue