Skip to content

Commit df49b4e

Browse files
priscilawebdevandrewshie-sentry
authored andcommitted
ref(onboarding): Normalize urls comparison with forceCustomDomain (#88528)
While adding more acceptance tests, I noticed this issue. - Contributes to #88302
1 parent 73f0d48 commit df49b4e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

static/app/views/onboarding/onboarding.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ function Onboarding(props: Props) {
9595

9696
useEffect(() => {
9797
if (
98-
props.location.pathname === `/onboarding/${onboardingSteps[2]!.id}/` &&
98+
normalizeUrl(props.location.pathname, {forceCustomerDomain: true}) ===
99+
`/onboarding/${onboardingSteps[2]!.id}/` &&
99100
props.location.query?.platform &&
100101
onboardingContext.selectedPlatform === undefined
101102
) {

static/app/views/onboarding/useBackActions.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type {Project} from 'sentry/types/project';
88
import {defined} from 'sentry/utils';
99
import {trackAnalytics} from 'sentry/utils/analytics';
1010
import {handleXhrErrorResponse} from 'sentry/utils/handleXhrErrorResponse';
11+
import normalizeUrl from 'sentry/utils/url/normalizeUrl';
1112
import useApi from 'sentry/utils/useApi';
1213
import useOrganization from 'sentry/utils/useOrganization';
1314
import {onboardingSteps} from 'sentry/views/onboarding/onboarding';
@@ -137,7 +138,9 @@ export function useBackActions({
137138
useBlocker(({historyAction, nextLocation}) => {
138139
if (historyAction === 'POP') {
139140
const prevStepIndex = onboardingSteps.findIndex(
140-
step => nextLocation.pathname === `/onboarding/${step.id}/`
141+
step =>
142+
normalizeUrl(nextLocation.pathname, {forceCustomerDomain: true}) ===
143+
`/onboarding/${step.id}/`
141144
);
142145
if (prevStepIndex < stepIndex) {
143146
backStepActions({

0 commit comments

Comments
 (0)