Skip to content

Commit

Permalink
fix: check for undefined tours in tour-provider (#1452)
Browse files Browse the repository at this point in the history
Signed-off-by: Jason C. Leach <[email protected]>
  • Loading branch information
jleach authored Feb 20, 2025
1 parent e9bd355 commit 7347852
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/legacy/core/App/contexts/tour/tour-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const TourProviderComponent = (props: TourProviderProps, ref: Ref<Tour>) => {
}, [renderStep, currentStep])

const tourStep = useMemo((): TourStep => {
return tours[currentTour]?.[currentStep ?? 0] ?? { Render: () => <></> }
return tours?.[currentTour]?.[currentStep ?? 0] ?? { Render: () => <></> }
}, [currentTour, currentStep, tours])

const tour = useMemo(
Expand Down

3 comments on commit 7347852

@fc-santos
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jleach good catch. How come you were getting undefined? The tours prop is required for the TourProvider. Could you please explain what configuration you had in your wallet that caused this error? Thanks

@jleach
Copy link
Contributor Author

@jleach jleach commented on 7347852 Feb 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just ran the BC Wallet noticed that "tours" was undefined. I think because we hadn't properly made changes to the BC Wallet after some recent refactoring. @bryce-mcmath Thoughts? I think you just brought in some of the recent changes to BC Wallet.

@bryce-mcmath
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We just hadn't updated BC Wallet main to use the new tours prop yet (it was still passing in each individual tour prop, the old way)

That's been fixed in the BC Wallet PR that got merged last night

Please sign in to comment.