fix(#943): don't convert ocean pattern image to base64 if pattern is toggled off

This commit is contained in:
Azgaar 2023-05-12 22:22:26 +04:00
parent 50a9411882
commit 44b486c101
3 changed files with 9 additions and 7 deletions

View file

@ -240,12 +240,14 @@ async function getMapURL(type, options = {}) {
if (location.hostname && cloneEl.getElementById("oceanicPattern")) {
const el = cloneEl.getElementById("oceanicPattern");
const url = el.getAttribute("href");
await new Promise(resolve => {
getBase64(url, base64 => {
el.setAttribute("href", base64);
resolve();
if (url) {
await new Promise(resolve => {
getBase64(url, base64 => {
el.setAttribute("href", base64);
resolve();
});
});
});
}
}
// add relief icons