prevent flashing when changing desktop wallpaper

This commit is contained in:
Bao Nguyen
2023-02-18 16:52:02 +07:00
parent 5d48879257
commit 4619844067

View File

@@ -19,9 +19,19 @@
let file = await get(fs_item.url);
url = URL.createObjectURL(file);
}
await load_image_url(url);
cached_url = url;
return url;
}
function load_image_url(url){
return new Promise(resolve => {
let image = new Image();
image.src = url;
image.onload = () => resolve();
})
}
</script>