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