Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions src/analyze/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,22 @@ document.getElementById('loadExample')!.onclick = () => {
fetch('example-metafile.json').then(r => r.text()).then(finishLoading)
}

if (location.hash !== '') {
// Load from the hash if it's present
try {
finishLoading(atob(location.hash.slice(1)))
} catch (e) {
}
function loadHash(){
if (location.hash !== '') {
// Load from the hash if it's present
try {
finishLoading(atob(location.hash.slice(1)))
} catch (e) {
}

// Clear out the hash afterward
try {
history.replaceState({}, '', location.pathname)
} catch (e) {
// Clear out the hash afterward
try {
history.replaceState({}, '', location.pathname)
} catch (e) {
}
}
}

window.addEventListener('hashchange', loadHash);

loadHash()