1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-25 06:24:19 +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 Coordinates from "../objects/Coordinates"
import MapArea from "../objects/MapArea" import MapArea from "../objects/MapArea"
@ -9,7 +9,10 @@ import MapArea from "../objects/MapArea"
export default function useMapAreaState() { export default function useMapAreaState() {
const [zoom, setZoom] = useState(3) const [zoom, setZoom] = useState(3)
const [center, setCenter] = useState(new Coordinates(0, 0)) const [center, setCenter] = useState(new Coordinates(0, 0))
const mapArea = MapArea.fromZoomLevel(zoom, center) const mapArea = useMemo(
() => MapArea.fromZoomLevel(zoom, center),
[zoom, center]
)
return { return {
zoom, zoom,

View file

@ -27,8 +27,6 @@ export class Condition {
} }
static fromRaw(data) { static fromRaw(data) {
console.debug("Trying to serialize condition: ", data)
if(data.type === 0) return ConditionHashtag.fromRaw(data) if(data.type === 0) return ConditionHashtag.fromRaw(data)
else if(data.type === 2) return ConditionTime.fromRaw(data) else if(data.type === 2) return ConditionTime.fromRaw(data)
else if(data.type === 3) return ConditionLocation.fromRaw(data) else if(data.type === 3) return ConditionLocation.fromRaw(data)

View file

@ -40,7 +40,7 @@ export default class Coordinates {
* @returns {string} * @returns {string}
*/ */
toString() { toString() {
return `${this.lat.toFixed(7)} ${this.lng.toFixed(7)}` return `${this.lat} ${this.lng}`
} }
/** /**