Skip to content

Commit

Permalink
Merge pull request #10877 from hassnian/issue-10876
Browse files Browse the repository at this point in the history
fix: Onboarding profile creation modal shown multiple times per session
  • Loading branch information
preschian authored Aug 26, 2024
2 parents 090d8af + 2eca00f commit 9842d91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/profile/ProfileDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,8 @@ const { accountId } = useAuth()
const { urlPrefix, client, setUrlPrefix } = usePrefix()
const { shareOnX, shareOnFarcaster } = useSocialShare()
const { redirectAfterChainChange } = useChainRedirect()
const profileOnboardingStore = useProfileOnboardingStore()
const { getIsOnboardingShown } = storeToRefs(profileOnboardingStore)
const { isRemark, isSub } = useIsChain(urlPrefix)
const listingCartStore = useListingCartStore()
Expand Down Expand Up @@ -798,7 +800,8 @@ watch(() => getPrefixByAddress(route.params.id.toString()), (prefix) => {
})
watchEffect(() => {
if (!hasProfile.value && !isFetchingProfile.value && isOwner.value) {
if (!hasProfile.value && !isFetchingProfile.value && isOwner.value && !getIsOnboardingShown.value) {
profileOnboardingStore.setOnboardingShown()
openProfileCreateModal()
}
})
Expand Down
1 change: 1 addition & 0 deletions stores/profileOnboarding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const useProfileOnboardingStore = defineStore('profileOnboarding', {
const { accountId } = useAuth()
return accountId.value && !state.onboardingShown && state.sidebarToggled && state.carouselVisited
},
getIsOnboardingShown: state => state.onboardingShown,
},
actions: {
setOnboardingShown() {
Expand Down

0 comments on commit 9842d91

Please sign in to comment.