This commit is contained in:
Pieter Vander Vennet 2025-10-13 10:13:12 +02:00
parent 604ea6fb3e
commit abe81abb22
7 changed files with 49 additions and 20 deletions

View file

@ -43,6 +43,7 @@
if (isClosed.data) {
await state.osmConnection.reopenNote(id, txt.data)
await state.osmConnection.closeNote(id)
NoteCommentElement.mimickStatusChange(tags, false)
} else {
await state.osmConnection.addCommentToNote(id, txt.data)
}
@ -54,16 +55,15 @@
async function closeNote() {
isProcessing.set(true)
await state.osmConnection.closeNote(id, txt.data)
isProcessing.set(false)
tags.data["closed_at"] = new Date().toISOString()
NoteCommentElement.addCommentTo(txt.data, tags, state)
tags.ping()
NoteCommentElement.mimickStatusChange(tags, false) // Will ping
isProcessing.set(false)
}
async function reopenNote() {
isProcessing.set(true)
await state.osmConnection.reopenNote(id, txt.data)
tags.data["closed_at"] = undefined
NoteCommentElement.mimickStatusChange(tags, true)
NoteCommentElement.addCommentTo(txt.data, tags, state)
tags.ping()
txt.set(undefined)