1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 04:54:18 +00:00

Merge remote-tracking branch 'origin/main' into main

This commit is contained in:
Lorenzo Balugani 2021-05-25 17:01:42 +02:00
commit 3bc2b3d6d2
3 changed files with 6 additions and 5 deletions

View file

@ -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,

View file

@ -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)

View file

@ -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}`
}
/**