Skip to content

Commit

Permalink
update previousUrl in handleRedirect
Browse files Browse the repository at this point in the history
  • Loading branch information
tyiuhc committed Oct 17, 2024
1 parent 1ad2630 commit 5dc054d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/experiment-tag/src/experiment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ const handleRedirect = (action, key: string, variant: Variant) => {
exposureWithDedupe(key, variant);

if (!matchesUrl([targetUrl], globalScope.location.href)) {
// set previous url - relevant for SPA if redirect happens before push/replaceState is complete
previousUrl = globalScope.location.href;
// perform redirection
globalScope.location.replace(targetUrl);
}
Expand Down

0 comments on commit 5dc054d

Please sign in to comment.