forked from MapComplete/MapComplete
Changes: expand try block; remove console.logs
This commit is contained in:
parent
abae813606
commit
27a43fdbe0
2 changed files with 7 additions and 14 deletions
|
@ -111,14 +111,14 @@ export class Changes {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async flushChangesAsync(flushreason: string = undefined): Promise<void> {
|
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 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 {
|
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: {
|
const changes: {
|
||||||
newObjects: OsmObject[],
|
newObjects: OsmObject[],
|
||||||
modifiedObjects: OsmObject[]
|
modifiedObjects: OsmObject[]
|
||||||
|
@ -311,6 +311,6 @@ export class Changes {
|
||||||
}
|
}
|
||||||
|
|
||||||
public registerIdRewrites(mappings: Map<string, string>): void {
|
public registerIdRewrites(mappings: Map<string, string>): void {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -66,9 +66,6 @@ export default class TagRenderingQuestion extends Combine {
|
||||||
return applicableMappings
|
return applicableMappings
|
||||||
}));
|
}));
|
||||||
|
|
||||||
applicableMappingsSrc.addCallbackAndRun(appl => console.log("Currently applicable renderings are:", appl.map(m => m.then.txt).join(", ")))
|
|
||||||
|
|
||||||
|
|
||||||
if (configuration === undefined) {
|
if (configuration === undefined) {
|
||||||
throw "A question is needed for a question visualization"
|
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 = () => {
|
const save = () => {
|
||||||
console.log("OnSaveTriggered", inputElement)
|
|
||||||
const selection = inputElement.GetValue().data;
|
const selection = inputElement.GetValue().data;
|
||||||
console.log("Saving changes", selection)
|
|
||||||
if (selection) {
|
if (selection) {
|
||||||
(State.state?.changes ?? new Changes())
|
(State.state?.changes ?? new Changes())
|
||||||
.applyAction(new ChangeTagAction(
|
.applyAction(new ChangeTagAction(
|
||||||
|
|
Loading…
Add table
Reference in a new issue