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);
|
const [popoverOpen, setPopoverOpen] = useState<boolean>(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (props.location) {
|
|
||||||
setState((state) => ({
|
setState((state) => ({
|
||||||
...state,
|
...state,
|
||||||
placeholder: props.location.placeholder || "",
|
placeholder: props.location?.placeholder || "",
|
||||||
position: new LatLng(props.location.latitude, props.location.longitude),
|
position: new LatLng(props.location?.latitude || 0, props.location?.longitude || 0),
|
||||||
latInput: String(props.location.latitude),
|
latInput: String(props.location?.latitude) || "",
|
||||||
lngInput: String(props.location.longitude),
|
lngInput: String(props.location?.longitude) || "",
|
||||||
}));
|
}));
|
||||||
} else {
|
// if (props.location) {
|
||||||
setState((state) => ({
|
// setState((state) => ({
|
||||||
...state,
|
// ...state,
|
||||||
placeholder: "",
|
// placeholder: props.location.placeholder || "",
|
||||||
position: undefined,
|
// position: new LatLng(props.location.latitude, props.location.longitude),
|
||||||
latInput: "",
|
// latInput: String(props.location.latitude),
|
||||||
lngInput: "",
|
// lngInput: String(props.location.longitude),
|
||||||
}));
|
// }));
|
||||||
}
|
// } else {
|
||||||
|
// setState((state) => ({
|
||||||
|
// ...state,
|
||||||
|
// placeholder: "",
|
||||||
|
// position: undefined,
|
||||||
|
// latInput: "",
|
||||||
|
// lngInput: "",
|
||||||
|
// }));
|
||||||
|
// }
|
||||||
}, [props.location]);
|
}, [props.location]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue