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

setup_number ping parameter #669

Merged
merged 16 commits into from Jan 29, 2021
Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Update setup_number to use fetchSearchEnginesAsync value for other dr…

…opdown list
  • Loading branch information
benstrumeyer committed Jan 27, 2021
commit d1c592324026f8f3c4ed72c095097b6c1220cfc1
@@ -19,3 +19,6 @@ export const BLOCK_SETTINGS = '2';
export const CHOOSE_DEFAULT_SEARCH = '3';
export const CHOOSE_PLAN = '4';
export const SUCCESS = '5';
export const SIGN_IN_SUCCESSFUL = '1';
export const CREATE_ACCOUNT_SUCCESSFUL = '2';
export const SKIP_ACCOUNT_CREATION = '3';
@@ -21,16 +21,6 @@ import {
SEARCH_BING,
SEARCH_YAHOO,
SEARCH_STARTPAGE,
SEARCH_DUCKDUCK_GO,
SEARCH_ECOSIA,
SEARCH_EKORU,
SEARCH_GIBIRU,
SEARCH_GOOGLE,
SEARCH_ONESEARCH,
SEARCH_PRIVADO,
SEARCH_QWANT,
SEARCH_ENCRYPT,
SEARCH_TAILCAT,
SEARCH_OTHER
} from './ChooseDefaultSearchConstants';
import { Modal } from '../../../../shared-components';
@@ -51,6 +41,7 @@ const mapSearchToSetupNumber = {
'Search Encrypt': 14,
Tailcat: 15,
};

class ChooseDefaultSearchView extends Component {
constructor(props) {
super(props);
@@ -68,6 +59,16 @@ class ChooseDefaultSearchView extends Component {
this.fetchSearchEnginesAsync = this.fetchSearchEnginesAsync.bind(this);
}

componentDidMount() {
document.addEventListener('click', this.handleClickAway);

this.fetchSearchEnginesAsync();
}

componentWillUnmount() {
document.removeEventListener('click', this.handleClickAway);
}

async fetchSearchEnginesAsync() {
// eslint-disable-next-line no-undef
if (typeof browser === 'undefined') { // we are not in Dawn (or Firefox)
@@ -95,16 +96,6 @@ class ChooseDefaultSearchView extends Component {
}));
}

componentDidMount() {
document.addEventListener('click', this.handleClickAway);

this.fetchSearchEnginesAsync();
}

componentWillUnmount() {
document.removeEventListener('click', this.handleClickAway);
}

updateSelection = () => this.setState(prevState => (
{
chosenSearch: prevState.searchBeingConsidered,
@@ -166,7 +157,7 @@ class ChooseDefaultSearchView extends Component {
setDefaultSearch(chosenSearch);
setSetupStep({
setup_step: CHOOSE_PLAN,
setup_number: mapSearchToSetupNumber[chosenSearch],
setup_number: mapSearchToSetupNumber[chosenSearchName],
origin: ONBOARDING
});
history.push(`/${ONBOARDING}/${CHOOSE_PLAN}`);
ProTip! Use n and p to navigate between commits in a pull request.