Avoid startup hiccup

This commit is contained in:
Will Scullin 2021-03-15 21:08:33 -07:00
parent ecef3010fd
commit e0ab1f9891
No known key found for this signature in database
GPG Key ID: 26DCD1042C6638CD
1 changed files with 7 additions and 1 deletions

View File

@ -819,7 +819,7 @@ export function clearPrinterPaper() {
_printer.clear();
}
export function initUI(apple2, disk2, smartPort, printer, e) {
function onLoaded(apple2, disk2, smartPort, printer, e) {
_apple2 = apple2;
cpu = _apple2.getCPU();
io = _apple2.getIO();
@ -929,3 +929,9 @@ export function initUI(apple2, disk2, smartPort, printer, e) {
});
}
}
export function initUI(apple2, disk2, smartPort, printer, e) {
window.addEventListener('load', () => {
onLoaded(apple2, disk2, smartPort, printer, e)
});
}