chore: automated housekeeping...

This commit is contained in:
Pieter Vander Vennet 2024-12-17 04:23:24 +01:00
parent 047d741b1d
commit 39a98ed4a1
30 changed files with 1362 additions and 1690 deletions

View file

@ -9,7 +9,7 @@ import { Utils } from "../../Utils"
import { GeoLocationState } from "../State/GeoLocationState"
import { OsmConnection } from "../Osm/OsmConnection"
"use strict"
;("use strict")
/**
* This actor is responsible to set the map location.
@ -27,7 +27,11 @@ export default class InitialMapPositioning {
public location: UIEventSource<{ lon: number; lat: number }>
public useTerrain: Store<boolean>
constructor(layoutToUse: ThemeConfig, geolocationState: GeoLocationState, osmConnection: OsmConnection) {
constructor(
layoutToUse: ThemeConfig,
geolocationState: GeoLocationState,
osmConnection: OsmConnection
) {
function localStorageSynced(
key: string,
deflt: number,
@ -49,7 +53,6 @@ export default class InitialMapPositioning {
return src
}
// -- Location control initialization
this.zoom = localStorageSynced(
"z",
@ -94,12 +97,11 @@ export default class InitialMapPositioning {
console.log("Loading note", initialHash)
const noteId = Number(initialHash)
if (osmConnection.isLoggedIn.data) {
osmConnection.getNote(noteId).then(note => {
const [lon, lat] = note.geometry.coordinates
console.log("Got note:", note)
this.location.set({ lon, lat })
}
)
osmConnection.getNote(noteId).then((note) => {
const [lon, lat] = note.geometry.coordinates
console.log("Got note:", note)
this.location.set({ lon, lat })
})
}
} else if (
Constants.GeoIpServer &&