Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Onboarding spreadsheet bugs #38 (GH-2259), #44 (GH-2306), and #45 (GH-2305) #675

Merged
merged 16 commits into from Mar 17, 2021
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Increase chance user object is available before choose plan view rend…

…er. Show expanded view if user picked Glow to match expected UX. Add TODOs so we remember to update AccountReducer to help distinguish between no user present and user not fetched yet
  • Loading branch information
wlycdgr committed Feb 9, 2021
commit b318fbea1821af29d655ca10ec67275188415dfa
@@ -28,7 +28,7 @@ import { UPDATE_PANEL_DATA } from '../panel/constants/constants';
const initialState = {
loggedIn: false,
userID: '',
user: null,
user: null, // TODO It would be better to have a way to distinguish between 'no user' and 'user not fetched yet'
userSettings: null,
subscriptionData: null,
toastMessage: '',
@@ -93,9 +93,11 @@ class ChoosePlanView extends React.Component {
super(props);
this.state = {
selectedPlan: '',
expanded: false
expanded: false,
readyToRender: false, // setTimeout does not block
};
// User object doesn't get populated immediately, let's delay the first render
// TODO can we do this in a way that guarantees user object will be available when we need it?
// TODO we prob need to updated AccountReducer so we have a way to distinguish between 'no user' and 'user not fetched yet'
setTimeout(this.setDefaultPlan, 200);
}

@@ -115,8 +117,13 @@ class ChoosePlanView extends React.Component {
}
if (isBasic && defaultSearch === SEARCH_GHOSTERY) {
this.selectPlusPlan();
this.setState({
expanded: true,
readyToRender: true,
});
} else {
this.selectBasicPlan();
this.setState({ readyToRender: true });
}
}

@@ -306,6 +313,9 @@ class ChoosePlanView extends React.Component {
};

render() {
const { readyToRender } = this.state;
if (!readyToRender) return null;

const {
actions,
defaultSearch,
ProTip! Use n and p to navigate between commits in a pull request.