Consistenly use hup to read hash

This commit is contained in:
Will Scullin 2021-10-03 11:08:46 -07:00
parent 2daef8040f
commit 8ab5faee8e
No known key found for this signature in database
GPG Key ID: 26DCD1042C6638CD

View File

@ -195,7 +195,7 @@ export function handleDrop(drive: number, event: DragEvent) {
for (let idx = 0; idx < dt.items.length; idx++) { for (let idx = 0; idx < dt.items.length; idx++) {
if (dt.items[idx].type === 'text/uri-list') { if (dt.items[idx].type === 'text/uri-list') {
dt.items[idx].getAsString(function (url) { dt.items[idx].getAsString(function (url) {
const parts = document.location.hash.split('|'); const parts = hup().split('|');
parts[drive - 1] = url; parts[drive - 1] = url;
document.location.hash = parts.join('|'); document.location.hash = parts.join('|');
}); });
@ -295,7 +295,7 @@ export function doLoad(event: MouseEvent|KeyboardEvent) {
} else { } else {
filename = url; filename = url;
} }
const parts = document.location.hash.split('|'); const parts = hup().split('|');
parts[_currentDrive - 1] = filename; parts[_currentDrive - 1] = filename;
document.location.hash = parts.join('|'); document.location.hash = parts.join('|');
} }
@ -384,7 +384,7 @@ function doLoadLocalDisk(drive: DriveNumber, file: File) {
const name = parts.join('.'); const name = parts.join('.');
// Remove any json file reference // Remove any json file reference
const files = document.location.hash.split('|'); const files = hup().split('|');
files[drive - 1] = ''; files[drive - 1] = '';
document.location.hash = files.join('|'); document.location.hash = files.join('|');