Fix needing to go back twice in archived item detail initial load (#1796)

Tested locally
This commit is contained in:
Emma Segal-Grossman 2024-05-14 17:25:50 -04:00 committed by GitHub
parent 76cd19d126
commit ed189efef4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -217,7 +217,7 @@ export class ArchivedItemDetail extends TailwindElement {
} else {
const newLocation = new URL(window.location.toString());
newLocation.hash = this.activeTab;
window.history.pushState(undefined, "", newLocation);
window.history.replaceState(undefined, "", newLocation);
}
super.connectedCallback();
window.addEventListener("hashchange", this.getActiveTabFromHash);
@ -683,7 +683,8 @@ export class ArchivedItemDetail extends TailwindElement {
? html`<div id="replay-crawl" class="aspect-4/3 overflow-hidden">
<replay-web-page
source="${replaySource}"
url="${this.crawl.seedCount === 1 && this.crawl.firstSeed || ""}"
url="${(this.crawl.seedCount === 1 && this.crawl.firstSeed) ||
""}"
coll="${ifDefined(this.crawl.id)}"
config="${config}"
replayBase="/replay/"