Skip to content

Commit

Permalink
fix: Revert type changes
Browse files Browse the repository at this point in the history
  • Loading branch information
calvin-codecov committed Jan 8, 2025
1 parent 4bac342 commit 08f6fb6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const HomePageRedirect = () => {
const { data: currentUser } = useUser()
const { data: internalUser } = useInternalUser({})
const { params } = useLocationParams()
// @ts-expect-error useLocationParams needs to be typed
const { setup_action: setupAction, to } = params

let redirectURL = '/login'
Expand Down
6 changes: 5 additions & 1 deletion src/pages/OwnerPage/OnboardingContainerContext/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ export const OnboardingContainerContext =
export const OnboardingContainerProvider: React.FC<React.PropsWithChildren> = ({
children,
}) => {
const { params } = useLocationParams()
const {
params,
}: {
params: { source?: string }
} = useLocationParams()
if (
params['source'] === ONBOARDING_SOURCE &&
localStorage.getItem(LOCAL_STORAGE_SHOW_ONBOARDING_CONTAINER) === null
Expand Down
4 changes: 1 addition & 3 deletions src/services/navigation/useLocationParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import omitBy from 'lodash/omitBy'
import qs from 'qs'
import { useHistory, useLocation } from 'react-router-dom'

export function useLocationParams(
defaultParams: Record<string, unknown> = {}
): Record<string, any> {
export function useLocationParams(defaultParams: Record<string, unknown> = {}) {
const { push } = useHistory()
const { pathname, search, state } = useLocation()
const params = state || {
Expand Down

0 comments on commit 08f6fb6

Please sign in to comment.