From fe57e12881d7e1aa2a5ce8250f2d871d356c51fd Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 9 Jul 2024 10:54:41 +0200 Subject: [PATCH] Add documentation --- src/Logic/Osm/OsmConnection.ts | 4 +--- src/Logic/Web/NameSuggestionIndex.ts | 2 ++ src/Models/ThemeConfig/TagRenderingConfig.ts | 1 + src/UI/Popup/Notes/AddNoteComment.svelte | 2 +- src/UI/i18n/Translations.ts | 3 +++ 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Logic/Osm/OsmConnection.ts b/src/Logic/Osm/OsmConnection.ts index ed9938712..246e1a1a5 100644 --- a/src/Logic/Osm/OsmConnection.ts +++ b/src/Logic/Osm/OsmConnection.ts @@ -488,9 +488,7 @@ export class OsmConnection { public addCommentToNote(id: number | string, text: string): Promise { if (this._dryRun.data) { console.warn("Dryrun enabled - not actually adding comment ", text, "to note ", id) - return new Promise((ok) => { - ok() - }) + return Utils.waitFor(1000) } if ((text ?? "") === "") { throw "Invalid text!" diff --git a/src/Logic/Web/NameSuggestionIndex.ts b/src/Logic/Web/NameSuggestionIndex.ts index dab89b047..ec28884e2 100644 --- a/src/Logic/Web/NameSuggestionIndex.ts +++ b/src/Logic/Web/NameSuggestionIndex.ts @@ -186,6 +186,8 @@ export default class NameSuggestionIndex { alsoShowIf: undefined, icon, iconClass: "medium", + // The 'frequency' is already for the country of the object we are working with + // As such, it should be "true" but this is not supported priorityIf: frequency > 0 ? new RegexTag("id", /.*/) : undefined, searchTerms: { "*": [nsiItem.displayName, nsiItem.id] }, }) diff --git a/src/Models/ThemeConfig/TagRenderingConfig.ts b/src/Models/ThemeConfig/TagRenderingConfig.ts index 2db0b6c91..4a1cd5d77 100644 --- a/src/Models/ThemeConfig/TagRenderingConfig.ts +++ b/src/Models/ThemeConfig/TagRenderingConfig.ts @@ -943,6 +943,7 @@ export class TagRenderingConfigUtils { return config } const clone: TagRenderingConfig = Object.create(config) + // The original mappings get "priorityIf" set const oldMappingsCloned = clone.mappings?.map((m) => ({ ...m, diff --git a/src/UI/Popup/Notes/AddNoteComment.svelte b/src/UI/Popup/Notes/AddNoteComment.svelte index 5dd4de186..109948210 100644 --- a/src/UI/Popup/Notes/AddNoteComment.svelte +++ b/src/UI/Popup/Notes/AddNoteComment.svelte @@ -53,10 +53,10 @@ 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() - isProcessing.set(false) } diff --git a/src/UI/i18n/Translations.ts b/src/UI/i18n/Translations.ts index 364ed9f08..da6b2591d 100644 --- a/src/UI/i18n/Translations.ts +++ b/src/UI/i18n/Translations.ts @@ -16,6 +16,9 @@ export default class Translations { throw "Translations is static. If you want to intitialize a new translation, use the singular form" } + /** + * @deprecated + */ public static W(s: string | number | boolean | BaseUIElement): BaseUIElement { if (typeof s === "string") { return new FixedUiElement(s)