Skip to content

Commit

Permalink
fix: #2372 sentry error type error when invite member (#2404)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pham Hai Duong authored Aug 19, 2020
1 parent 9e8269b commit 768f5f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/developer-portal/src/core/private-route-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,11 @@ export const PrivateRouteWrapper: React.FunctionComponent<PrivateRouteWrapperPro
const location = useLocation()
const currentUri = `${location.pathname}${location.search}`
const isRoot = connectInternalRedirect === '/'
const hasReadWelcome = Boolean(getCookieString(COOKIE_DEVELOPER_FIRST_TIME_LOGIN_COMPLETE))

if (!connectSession) {
return null
}

if (!hasReadWelcome && location.pathname === Routes.APPS) {
return <Redirect to={Routes.WELCOME} />
}

if (
(connectInternalRedirect && currentUri !== connectInternalRedirect) ||
(currentUri === connectInternalRedirect && isRoot)
Expand All @@ -49,6 +44,11 @@ export const PrivateRouteWrapper: React.FunctionComponent<PrivateRouteWrapperPro
return <Redirect to={redirectUri} />
}

const hasReadWelcome = Boolean(getCookieString(COOKIE_DEVELOPER_FIRST_TIME_LOGIN_COMPLETE))
if (!hasReadWelcome && location.pathname === Routes.APPS) {
return <Redirect to={Routes.WELCOME} />
}

return (
<AppNavContainer>
{showMenu && <Menu />}
Expand Down

0 comments on commit 768f5f8

Please sign in to comment.