Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Persist referrer value in sessionStorage across URLs #4585

Merged
merged 2 commits into from
Dec 14, 2023
Merged
Changes from 1 commit
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
10 changes: 7 additions & 3 deletions apps/pwabuilder/src/script/pages/app-home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,12 @@ export class AppHome extends LitElement {
}

async firstUpdated() {
// Resetting for a new url
// Resetting for a new url, keep referrer value
const referrer = sessionStorage.getItem('ref');
sessionStorage.clear();
if(referrer){
sessionStorage.setItem('ref', referrer);
}
zateutsch marked this conversation as resolved.
Show resolved Hide resolved
resetInitialManifest();

const search = new URLSearchParams(location.search);
Expand Down Expand Up @@ -528,7 +532,7 @@ export class AppHome extends LitElement {
</h1>
<section id="content-grid" slot="grid-container">
<div class="intro-grid-item">
<div class="grid-item-header">
<div class="grid-item-header">
<a @click=${() => recordPWABuilderProcessStep("top.PWAStarter_clicked", AnalyticsBehavior.ProcessCheckpoint)} href="https://docs.pwabuilder.com/#/starter/quick-start" target="_blank" rel="noopener" aria-label="Start a new pwa, will open in separate tab">Start a new PWA</a>
<img src="/assets/new/arrow.svg" alt="arrow"/>

Expand All @@ -539,7 +543,7 @@ export class AppHome extends LitElement {
</div>

<div class="intro-grid-item">
<div class="grid-item-header">
<div class="grid-item-header">
<a @click=${() => recordPWABuilderProcessStep("home.top.PWAStudio_clicked", AnalyticsBehavior.ProcessCheckpoint)} href="https://aka.ms/install-pwa-studio" target="_blank" rel="noopener" aria-label="Use dev tools, will open a separate tab">Use dev tools</a>
<img src="/assets/new/arrow.svg" alt="arrow"/>
</div>
Expand Down
Loading