From a05ee0eedcbe4a01a244970881861c780b332df2 Mon Sep 17 00:00:00 2001 From: exyi Date: Sun, 27 Sep 2020 11:12:41 +0000 Subject: [PATCH] Fix TS error --- frontend/src/ksp-task-grabber.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/ksp-task-grabber.ts b/frontend/src/ksp-task-grabber.ts index 2a63cce..59cd10c 100644 --- a/frontend/src/ksp-task-grabber.ts +++ b/frontend/src/ksp-task-grabber.ts @@ -31,9 +31,9 @@ function getLocation(id: string, solution: boolean): TaskLocation { } } -function parseTask(startElementId: string, html: string, contentType: DOMParserSupportedType): string { +function parseTask(startElementId: string, html: string, contentType: string): string { const parser = new DOMParser() - const doc = parser.parseFromString(html, contentType) + const doc = parser.parseFromString(html, contentType as any) const titleElement = doc.getElementById(startElementId) if (!titleElement) @@ -69,7 +69,7 @@ async function loadTask({ url, startElement }: TaskLocation) { throw Error("Bad request") } const rText = await r.text() - const contentType = r.headers.get("Content-Type") as DOMParserSupportedType || "text/html" + const contentType = r.headers.get("Content-Type") || "text/html" return parseTask(startElement, rText, contentType) }