Chore: fix lint errors

This commit is contained in:
Pieter Vander Vennet 2025-04-04 02:25:03 +02:00
parent 43e882d38e
commit a4128e446e

View file

@ -368,22 +368,25 @@ export class Changes {
states.set(id, "created")
let osmObj: OsmObject = undefined
switch (change.type) {
case "node":
case "node": {
const n = new OsmNode(change.id)
n.lat = change.changes["lat"]
n.lon = change.changes["lon"]
osmObj = n
break
case "way":
}
case "way": {
const w = new OsmWay(change.id)
w.nodes = change.changes["nodes"]
osmObj = w
break
case "relation":
}
case "relation": {
const r = new OsmRelation(change.id)
r.members = change.changes["members"]
osmObj = r
break
}
default:
throw "Got an invalid change.type: " + change.type
}
@ -424,10 +427,8 @@ export class Changes {
if (change.changes !== undefined) {
switch (change.type) {
case "node":
// @ts-ignore
case "node": {
const nlat = Utils.Round7(change.changes.lat)
// @ts-ignore
const nlon = Utils.Round7(change.changes.lon)
const n = <OsmNode>obj
if (n.lat !== nlat || n.lon !== nlon) {
@ -436,7 +437,8 @@ export class Changes {
changed = true
}
break
case "way":
}
case "way": {
const nnodes = change.changes["nodes"]
const w = <OsmWay>obj
if (!Utils.Identical(nnodes, w.nodes)) {
@ -444,7 +446,8 @@ export class Changes {
changed = true
}
break
case "relation":
}
case "relation": {
const nmembers: {
type: "node" | "way" | "relation"
ref: number
@ -460,6 +463,7 @@ export class Changes {
changed = true
}
break
}
}
}
@ -600,6 +604,7 @@ export class Changes {
e +
")"
// this._reportError(msg) // We don't report this yet, might be a temporary fluke
console.log(msg)
const osmObj = await downloader.DownloadObjectAsync(id, 0)
return { id, osmObj }
}
@ -811,10 +816,9 @@ export class Changes {
}
private async flushChangesAsync(): Promise<void> {
const self = this
try {
// At last, we build the changeset and upload
const pending = self.pendingChanges.data
const pending = this.pendingChanges.data
const pendingPerTheme = new Map<string, ChangeDescription[]>()
for (const changeDescription of pending) {
@ -840,7 +844,7 @@ export class Changes {
openChangeset.data
)
const refused = await self.flushSelectChanges(pendingChanges, openChangeset)
const refused = await this.flushSelectChanges(pendingChanges, openChangeset)
if (!refused) {
this.errors.setData([])
}
@ -873,9 +877,9 @@ export class Changes {
)
this.errors.data.push(e)
this.errors.ping()
self.pendingChanges.setData([])
this.pendingChanges.setData([])
} finally {
self.isUploading.setData(false)
this.isUploading.setData(false)
}
}
}