Changes: expand try block; remove console.logs

This commit is contained in:
pietervdvn 2021-10-03 21:53:31 +02:00
parent abae813606
commit 27a43fdbe0
2 changed files with 7 additions and 14 deletions

View file

@ -111,14 +111,14 @@ export class Changes {
}
private async flushChangesAsync(flushreason: string = undefined): Promise<void> {
console.log("Beginning upload... " + flushreason ?? "");
// At last, we build the changeset and upload
const self = this;
const pending = self.pendingChanges.data;
const neededIds = Changes.GetNeededIds(pending)
const osmObjects = await Promise.all(neededIds.map(id => OsmObject.DownloadObjectAsync(id)));
console.log("Got the fresh objects!", osmObjects, "pending: ", pending)
try {
console.log("Beginning upload... " + flushreason ?? "");
// At last, we build the changeset and upload
const pending = self.pendingChanges.data;
const neededIds = Changes.GetNeededIds(pending)
const osmObjects = await Promise.all(neededIds.map(id => OsmObject.DownloadObjectAsync(id)));
console.log("Got the fresh objects!", osmObjects, "pending: ", pending)
const changes: {
newObjects: OsmObject[],
modifiedObjects: OsmObject[]
@ -311,6 +311,6 @@ export class Changes {
}
public registerIdRewrites(mappings: Map<string, string>): void {
}
}

View file

@ -66,9 +66,6 @@ export default class TagRenderingQuestion extends Combine {
return applicableMappings
}));
applicableMappingsSrc.addCallbackAndRun(appl => console.log("Currently applicable renderings are:", appl.map(m => m.then.txt).join(", ")))
if (configuration === undefined) {
throw "A question is needed for a question visualization"
}
@ -84,12 +81,8 @@ export default class TagRenderingQuestion extends Combine {
))
// inputElement.GetValue().addCallbackAndRun(s => console.trace(configuration.question.txt, "Current selection is ", s))
const save = () => {
console.log("OnSaveTriggered", inputElement)
const selection = inputElement.GetValue().data;
console.log("Saving changes", selection)
if (selection) {
(State.state?.changes ?? new Changes())
.applyAction(new ChangeTagAction(