Disable image preload

This commit is contained in:
Fedor Indutny
2023-05-01 13:42:34 -07:00
committed by GitHub
parent 6154b83720
commit 00349b5b33
5 changed files with 0 additions and 58 deletions

View File

@@ -543,19 +543,6 @@ export async function startApp(): Promise<void> {
startInteractionMode();
// Load these images now to ensure that they don't flicker on first use
window.preloadedImages = [];
function preload(list: ReadonlyArray<string>) {
for (let index = 0, max = list.length; index < max; index += 1) {
const image = new Image();
image.src = `./images/${list[index]}`;
window.preloadedImages.push(image);
}
}
const builtInImages = await window.IPC.getBuiltInImages();
preload(builtInImages);
// We add this to window here because the default Node context is erased at the end
// of preload.js processing
window.setImmediate = window.nodeSetImmediate;