From a77f53fd94d8a83d03cb62373051f05e859098db Mon Sep 17 00:00:00 2001 From: Chen-I Lim <46905241+chenilim@users.noreply.github.com> Date: Wed, 2 Mar 2022 06:46:46 -0800 Subject: [PATCH] Fix for #2430. Bypass Welcome screen for Personal Desktop. (#2431) * Partial fix for #2430 * Fix #2430. Bypass welcome screen for Personal Desktop * Skip welcome page only for Personal Desktop * Removed API changes. Webapp changes were sufficient Co-authored-by: Harshil Sharma --- webapp/src/app.tsx | 2 +- webapp/src/pages/welcome/welcomePage.tsx | 2 +- webapp/src/store/users.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/webapp/src/app.tsx b/webapp/src/app.tsx index d62dcae6d..85594cf8a 100644 --- a/webapp/src/app.tsx +++ b/webapp/src/app.tsx @@ -102,7 +102,7 @@ const App = (props: Props): JSX.Element => { } const continueToWelcomeScreen = () => { - return loggedIn === true && !me?.props[UserPropPrefix + UserSettingKey.WelcomePageViewed] + return (me?.id !== 'single-user') && loggedIn === true && !(me?.props && me?.props[UserPropPrefix + UserSettingKey.WelcomePageViewed]) } return ( diff --git a/webapp/src/pages/welcome/welcomePage.tsx b/webapp/src/pages/welcome/welcomePage.tsx index 2d1408e10..3be2ecdca 100644 --- a/webapp/src/pages/welcome/welcomePage.tsx +++ b/webapp/src/pages/welcome/welcomePage.tsx @@ -86,7 +86,7 @@ const WelcomePage = () => { history.replace(newPath) } - if (me?.props[UserPropPrefix + UserSettingKey.WelcomePageViewed]) { + if (me?.props && me?.props[UserPropPrefix + UserSettingKey.WelcomePageViewed]) { goForward() return null } diff --git a/webapp/src/store/users.ts b/webapp/src/store/users.ts index eb83510c1..ecf441e71 100644 --- a/webapp/src/store/users.ts +++ b/webapp/src/store/users.ts @@ -112,7 +112,7 @@ export const getOnboardingTourStarted = createSelector( return false } - return Boolean(me.props.focalboard_onboardingTourStarted) + return Boolean(me.props?.focalboard_onboardingTourStarted) }, ) @@ -123,11 +123,11 @@ export const getOnboardingTourStep = createSelector( return '' } - return me.props.focalboard_onboardingTourStep + return me.props?.focalboard_onboardingTourStep }, ) export const getOnboardingTourCategory = createSelector( getMe, - (me): string => (me ? me.props.focalboard_tourCategory : ''), + (me): string => (me ? me.props?.focalboard_tourCategory : ''), )