Don't reload already loaded disk (#174)
This commit is contained in:
parent
9173bff1ba
commit
d042a5b319
|
@ -46,6 +46,7 @@ let lastFrames = 0;
|
||||||
let lastRenderedFrames = 0;
|
let lastRenderedFrames = 0;
|
||||||
|
|
||||||
let hashtag = document.location.hash;
|
let hashtag = document.location.hash;
|
||||||
|
let oldHashFiles: string[] = [];
|
||||||
|
|
||||||
const options = new Options();
|
const options = new Options();
|
||||||
const optionsModal = new OptionsModal(options);
|
const optionsModal = new OptionsModal(options);
|
||||||
|
@ -748,6 +749,9 @@ function processHash(hash: string) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
const file = files[idx];
|
const file = files[idx];
|
||||||
|
if (file === oldHashFiles[idx]) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (file.indexOf('://') > 0) {
|
if (file.indexOf('://') > 0) {
|
||||||
const parts = file.split('.');
|
const parts = file.split('.');
|
||||||
const ext = parts[parts.length - 1].toLowerCase();
|
const ext = parts[parts.length - 1].toLowerCase();
|
||||||
|
@ -760,6 +764,7 @@ function processHash(hash: string) {
|
||||||
loadAjax(drive, 'json/disks/' + file + '.json');
|
loadAjax(drive, 'json/disks/' + file + '.json');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
oldHashFiles = files;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function updateUI() {
|
export function updateUI() {
|
||||||
|
|
Loading…
Reference in New Issue