Fix: MC would crash if a pending change was present; remember preferences in order to reuse the changeset

This commit is contained in:
Pieter Vander Vennet 2023-10-05 15:55:18 +02:00
parent 6760897a6f
commit f2375f4877
6 changed files with 291 additions and 261 deletions

View file

@ -558,19 +558,8 @@ export class Changes {
const successes = await Promise.all(
Array.from(pendingPerTheme, async ([theme, pendingChanges]) => {
try {
const openChangeset = this.state.osmConnection
.GetPreference("current-open-changeset-" + theme)
.sync(
(str) => {
const n = Number(str)
if (isNaN(n)) {
return undefined
}
return n
},
[],
(n) => "" + n
)
const openChangeset = UIEventSource.asInt(this.state.osmConnection
.GetPreference("current-open-changeset-" + theme))
console.log(
"Using current-open-changeset-" +
theme +