From d042a5b319d81baff32de97a14310b7f78a2a7df Mon Sep 17 00:00:00 2001 From: Will Scullin Date: Sun, 22 Jan 2023 18:31:35 -0800 Subject: [PATCH] Don't reload already loaded disk (#174) --- js/ui/apple2.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/ui/apple2.ts b/js/ui/apple2.ts index db081d5..39d7dc0 100644 --- a/js/ui/apple2.ts +++ b/js/ui/apple2.ts @@ -46,6 +46,7 @@ let lastFrames = 0; let lastRenderedFrames = 0; let hashtag = document.location.hash; +let oldHashFiles: string[] = []; const options = new Options(); const optionsModal = new OptionsModal(options); @@ -748,6 +749,9 @@ function processHash(hash: string) { break; } const file = files[idx]; + if (file === oldHashFiles[idx]) { + continue; + } if (file.indexOf('://') > 0) { const parts = file.split('.'); const ext = parts[parts.length - 1].toLowerCase(); @@ -760,6 +764,7 @@ function processHash(hash: string) { loadAjax(drive, 'json/disks/' + file + '.json'); } } + oldHashFiles = files; } export function updateUI() {