forked from MapComplete/MapComplete
Chore: linting
This commit is contained in:
parent
4625ad9a5c
commit
097141f944
307 changed files with 5346 additions and 2147 deletions
25
src/index.ts
25
src/index.ts
|
@ -31,7 +31,7 @@ async function getAvailableLayers(): Promise<Set<string>> {
|
|||
const host = new URL(Constants.VectorTileServer).host
|
||||
const status: { layers: string[] } = await Promise.any([
|
||||
// Utils.downloadJson("https://" + host + "/summary/status.json"),
|
||||
timeout(0)
|
||||
timeout(0),
|
||||
])
|
||||
return new Set<string>(status.layers)
|
||||
} catch (e) {
|
||||
|
@ -48,13 +48,13 @@ async function main() {
|
|||
}
|
||||
const [layout, availableLayers] = await Promise.all([
|
||||
DetermineLayout.GetLayout(),
|
||||
await getAvailableLayers()
|
||||
await getAvailableLayers(),
|
||||
])
|
||||
console.log("The available layers on server are", Array.from(availableLayers))
|
||||
const state = new ThemeViewState(layout, availableLayers)
|
||||
const main = new SvelteUIElement(ThemeViewGUI, { state })
|
||||
main.AttachTo("maindiv")
|
||||
Array.from(document.getElementsByClassName("delete-on-load")).forEach(el => {
|
||||
Array.from(document.getElementsByClassName("delete-on-load")).forEach((el) => {
|
||||
el.parentElement.removeChild(el)
|
||||
})
|
||||
} catch (err) {
|
||||
|
@ -65,17 +65,16 @@ async function main() {
|
|||
|
||||
customDefinition?.length > 0
|
||||
? new SubtleButton(new SvelteUIElement(Download), "Download the raw file").onClick(
|
||||
() =>
|
||||
Utils.offerContentsAsDownloadableFile(
|
||||
DetermineLayout.getCustomDefinition(),
|
||||
"mapcomplete-theme.json",
|
||||
{ mimetype: "application/json" }
|
||||
)
|
||||
)
|
||||
: undefined
|
||||
() =>
|
||||
Utils.offerContentsAsDownloadableFile(
|
||||
DetermineLayout.getCustomDefinition(),
|
||||
"mapcomplete-theme.json",
|
||||
{ mimetype: "application/json" }
|
||||
)
|
||||
)
|
||||
: undefined,
|
||||
]).AttachTo("maindiv")
|
||||
}
|
||||
}
|
||||
|
||||
main().then((_) => {
|
||||
})
|
||||
main().then((_) => {})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue