forked from MapComplete/MapComplete
More refactoring
This commit is contained in:
parent
231f4f2c97
commit
6890c5189e
12 changed files with 52 additions and 59 deletions
|
@ -51,14 +51,14 @@ export default class DeleteWizard extends Toggle {
|
|||
const confirm = new UIEventSource<boolean>(false)
|
||||
|
||||
|
||||
function softDelete(reason: string, tagsToApply: { k: string, v: string }[]) {
|
||||
async function softDelete(reason: string, tagsToApply: { k: string, v: string }[]) {
|
||||
if (reason !== undefined) {
|
||||
tagsToApply.splice(0, 0, {
|
||||
k: "fixme",
|
||||
v: `A mapcomplete user marked this feature to be deleted (${reason})`
|
||||
})
|
||||
}
|
||||
(State.state?.changes ?? new Changes())
|
||||
await (State.state?.changes ?? new Changes())
|
||||
.applyAction(new ChangeTagAction(
|
||||
id, new And(tagsToApply.map(kv => new Tag(kv.k, kv.v))), tagsSource.data
|
||||
))
|
||||
|
|
|
@ -58,10 +58,10 @@ export default class TagRenderingQuestion extends Combine {
|
|||
console.error("MultiAnswer failed - probably not a single option was possible", configuration)
|
||||
throw "MultiAnswer failed - probably not a single option was possible"
|
||||
}
|
||||
const save = () => {
|
||||
const save = async () => {
|
||||
const selection = inputElement.GetValue().data;
|
||||
if (selection) {
|
||||
(State.state?.changes ?? new Changes())
|
||||
await (State.state?.changes ?? new Changes())
|
||||
.applyAction(new ChangeTagAction(
|
||||
tags.data.id, selection, tags.data
|
||||
))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue