Skip to content

Commit

Permalink
Merge pull request #23424 from storybookjs/fix/whats-new-onboarding-d…
Browse files Browse the repository at this point in the history
…etection

Core: Improve onboarding detection in what's new module
  • Loading branch information
kasperpeulen authored Jul 13, 2023
2 parents 04b9e28 + 3810fd1 commit 41973a7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions code/lib/manager-api/src/modules/whatsnew.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ export const init: ModuleFn = ({ fullAPI, store }) => {
const whatsNewData = await getLatestWhatsNewPost();
setWhatsNewState(whatsNewData);

const isNewStoryBookUser = fullAPI.getUrlState().path.includes('onboarding');
const urlState = fullAPI.getUrlState();
const isOnboardingView =
urlState?.path === '/onboarding' || urlState.queryParams?.onboarding === 'true';

if (
!isNewStoryBookUser &&
!isOnboardingView &&
whatsNewData.status === 'SUCCESS' &&
!whatsNewData.disableWhatsNewNotifications &&
whatsNewData.showNotification
Expand Down

0 comments on commit 41973a7

Please sign in to comment.