Skip to content

Commit

Permalink
[bugfix/wv-45] <back button fix on FindFriendsRoot>
Browse files Browse the repository at this point in the history
  • Loading branch information
pbnjcub committed Feb 7, 2024
1 parent e1feac0 commit 9cb1c8b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/js/pages/Friends/FindFriendsRoot.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class FindFriendsRoot extends React.Component {
voterFirstName: '',
voterPhotoUrlLarge: '',
};
console.log('Constructor: backButtonOn initialized to:', this.state.backButtonOn);
}

componentDidMount () {
Expand All @@ -87,6 +88,9 @@ class FindFriendsRoot extends React.Component {
this.setState({
displayStep,
setUpPagePath,
}, () => {
//i added this to set the next step variables like componentDidUpdate
this.setNextStepVariables();
});
// this.onBallotStoreChange();
// this.ballotStoreListener = BallotStore.addListener(this.onBallotStoreChange.bind(this));
Expand Down Expand Up @@ -136,7 +140,9 @@ class FindFriendsRoot extends React.Component {
this.setState({
displayStep,
setUpPagePath,
}, () => this.setNextStepVariables());
}, () => {
this.setNextStepVariables();
});
} else if ((setUpPagePath === 'importcontacts') && (voterContactEmailListCount > 0 && (voterContactEmailListCountPrevious !== voterContactEmailListCount))) {
// console.log('Leaving importcontacts step');
this.resetNextButtonClicked();
Expand Down Expand Up @@ -254,6 +260,7 @@ class FindFriendsRoot extends React.Component {

goToNextStep = () => {
this.resetNextButtonClicked();

const { nextStepPath } = this.state;
// console.log('FindFriendsRoot goToNextStep nextStepPath:', nextStepPath);
if (nextStepPath) {
Expand Down Expand Up @@ -336,6 +343,7 @@ class FindFriendsRoot extends React.Component {
} else {
skipForNowPath = '/ready';
}

} else if (friendConnectionActionAvailable) {
nextButtonText = 'Next';
nextStepPath = '/findfriends/friendrequests';
Expand All @@ -349,6 +357,8 @@ class FindFriendsRoot extends React.Component {
nextStepPath = '/ready';
skipForNowPath = '/ready';
}
console.log('setNextStepVariables [Condition1]: backButtonOn changing to', backButtonOn);

break;
case 2: // signin
// console.log('setUpAccountEntryPath:', setUpAccountEntryPath, ', setUpAccountBackLinkPath:', setUpAccountBackLinkPath);
Expand Down Expand Up @@ -414,8 +424,10 @@ class FindFriendsRoot extends React.Component {
skipForNowPath = '/ready';
}
editNameStepVisited = true;

break;
case 4: // 'addphoto'

case 5:
backButtonOn = true;
desktopFixedButtonsOn = false;
Expand Down Expand Up @@ -468,6 +480,7 @@ class FindFriendsRoot extends React.Component {
}
addPhotoStepVisited = true;
break;

case 6: // invitecontacts
backButtonOn = true;
desktopFixedButtonsOn = true;
Expand Down Expand Up @@ -496,6 +509,7 @@ class FindFriendsRoot extends React.Component {
skipForNowPath = '/ready';
}
break;

case 7: // friendrequests
backButtonOn = true;
desktopFixedButtonsOn = true;
Expand All @@ -515,6 +529,7 @@ class FindFriendsRoot extends React.Component {
skipForNowPath = '/ready';
reassuranceTextOff = true;
break;

}
this.setState({
addPhotoStepVisited,
Expand Down

0 comments on commit 9cb1c8b

Please sign in to comment.