diff --git a/nest_frontend/hooks/useMapAreaState.js b/nest_frontend/hooks/useMapAreaState.js index f1b8354..75a94c6 100644 --- a/nest_frontend/hooks/useMapAreaState.js +++ b/nest_frontend/hooks/useMapAreaState.js @@ -1,4 +1,4 @@ -import { useState } from "react" +import { useMemo, useState } from "react" import Coordinates from "../objects/Coordinates" import MapArea from "../objects/MapArea" @@ -9,7 +9,10 @@ import MapArea from "../objects/MapArea" export default function useMapAreaState() { const [zoom, setZoom] = useState(3) const [center, setCenter] = useState(new Coordinates(0, 0)) - const mapArea = MapArea.fromZoomLevel(zoom, center) + const mapArea = useMemo( + () => MapArea.fromZoomLevel(zoom, center), + [zoom, center] + ) return { zoom, diff --git a/nest_frontend/objects/Condition.js b/nest_frontend/objects/Condition.js index a0d972f..4bae4bf 100644 --- a/nest_frontend/objects/Condition.js +++ b/nest_frontend/objects/Condition.js @@ -27,8 +27,6 @@ export class Condition { } static fromRaw(data) { - console.debug("Trying to serialize condition: ", data) - if(data.type === 0) return ConditionHashtag.fromRaw(data) else if(data.type === 2) return ConditionTime.fromRaw(data) else if(data.type === 3) return ConditionLocation.fromRaw(data) diff --git a/nest_frontend/objects/Coordinates.js b/nest_frontend/objects/Coordinates.js index e6b2ab0..060d5a7 100644 --- a/nest_frontend/objects/Coordinates.js +++ b/nest_frontend/objects/Coordinates.js @@ -40,7 +40,7 @@ export default class Coordinates { * @returns {string} */ toString() { - return `${this.lat.toFixed(7)} ${this.lng.toFixed(7)}` + return `${this.lat} ${this.lng}` } /**