diff options
Diffstat (limited to 'webAO/dom/updateBackgroundPreview.ts')
| -rw-r--r-- | webAO/dom/updateBackgroundPreview.ts | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/webAO/dom/updateBackgroundPreview.ts b/webAO/dom/updateBackgroundPreview.ts index b41ee8f..0daea74 100644 --- a/webAO/dom/updateBackgroundPreview.ts +++ b/webAO/dom/updateBackgroundPreview.ts @@ -15,14 +15,13 @@ export function updateBackgroundPreview() { if (background_select.selectedIndex === 0) { background_filename.style.display = "initial"; - background_preview.src = `${AO_HOST}background/${encodeURI( - background_filename.value.toLowerCase() - )}/defenseempty.png`; } else { background_filename.style.display = "none"; - background_preview.src = `${AO_HOST}background/${encodeURI( - background_select.value.toLowerCase() - )}/defenseempty.png`; } + tryUrls(`${AO_HOST}background/${encodeURI( + background_select.value.toLowerCase() + )}/defenseempty`).then((resp) => { + background_preview.src = resp; + }); } -window.updateBackgroundPreview = updateBackgroundPreview;
\ No newline at end of file +window.updateBackgroundPreview = updateBackgroundPreview; |
