From 3204a76fc97b61506026d48d45d31299e3e0f25b Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 16 May 2024 00:26:28 +0200 Subject: [PATCH] Cleanup imports, improve typing --- src/UI/Popup/TagRendering/TagRenderingEditable.svelte | 3 --- src/Utils.ts | 8 ++++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/UI/Popup/TagRendering/TagRenderingEditable.svelte b/src/UI/Popup/TagRendering/TagRenderingEditable.svelte index 8bbb001dd3..3125a56ab7 100644 --- a/src/UI/Popup/TagRendering/TagRenderingEditable.svelte +++ b/src/UI/Popup/TagRendering/TagRenderingEditable.svelte @@ -4,7 +4,6 @@ import type { Feature } from "geojson" import type { SpecialVisualizationState } from "../../SpecialVisualization" import TagRenderingAnswer from "./TagRenderingAnswer.svelte" - import { PencilAltIcon } from "@rgossiaux/svelte-heroicons/solid" import TagRenderingQuestion from "./TagRenderingQuestion.svelte" import { onDestroy } from "svelte" import Tr from "../../Base/Tr.svelte" @@ -12,9 +11,7 @@ import LayerConfig from "../../../Models/ThemeConfig/LayerConfig" import { Utils } from "../../../Utils" import { twMerge } from "tailwind-merge" - import { ariaLabel } from "../../../Utils/ariaLabel" import EditButton from "./EditButton.svelte" - import EditItemButton from "../../Studio/EditItemButton.svelte" export let config: TagRenderingConfig export let tags: UIEventSource> diff --git a/src/Utils.ts b/src/Utils.ts index 141bdaa0e7..21b6512a57 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -1035,7 +1035,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be } } const promise = - /*NO AWAIT as we work with the promise directly */ Utils.downloadJsonAdvanced( + /*NO AWAIT as we work with the promise directly */ Utils.downloadJsonAdvanced( url, headers ) @@ -1069,11 +1069,11 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be }) } - public static async downloadJsonAdvanced( + public static async downloadJsonAdvanced( url: string, headers?: Record ): Promise< - { content: object | object[] } | { error: string; url: string; statuscode?: number } + { content: T } | { error: string; url: string; statuscode?: number } > { const injected = Utils.injectedDownloads[url] if (injected !== undefined) { @@ -1091,7 +1091,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be try { if (typeof data === "string") { if (data === "") { - return { content: {} } + return { content: {} } } return { content: JSON.parse(data) } }