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

GH-2213 bugfix: Broken Next button #678

@@ -12,18 +12,19 @@
*/

export const SET_DEFAULT_SEARCH = 'SET_DEFAULT_SEARCH';
export const DAWN_SETUP_NUMBER_FOR_UNLISTED_OR_RENAMED_SEARCH = 0;
export const SEARCH_GHOSTERY = 'Ghostery';
export const SEARCH_BING = 'Bing';
export const SEARCH_YAHOO = 'Yahoo';
export const SEARCH_STARTPAGE = 'StartPage';
export const SEARCH_STARTPAGE = 'Startpage';
export const SEARCH_DUCKDUCK_GO = 'DuckDuckGo';
export const SEARCH_ECOSIA = 'Ecosia Search';
export const SEARCH_EKORU = 'ekoru';
export const SEARCH_GIBIRU = 'Gibiru.com';
export const SEARCH_ECOSIA = 'Ecosia';
export const SEARCH_EKORU = 'Ekoru';
export const SEARCH_GIBIRU = 'Gibiru';
export const SEARCH_GOOGLE = 'Google';
export const SEARCH_ONESEARCH = 'OneSearch';
export const SEARCH_PRIVADO = 'Privado';
export const SEARCH_QWANT = 'Qwant';
export const SEARCH_ENCRYPT = 'TODO: Add Search Encrypt browser.search.get() string';
export const SEARCH_ENCRYPT = 'SearchEncrypt'; // TODO this is just our best guess. Once Search Encrypt is added on the Dawn side, we should confirm, particularly if we start getting a lot of DAWN_SETUP_NUMBER_FOR_UNLISTED_OR_RENAMED_SEARCH pings
export const SEARCH_TAILCAT = 'Tailcat';
export const SEARCH_OTHER = t('ghostery_dawn_onboarding_other');
@@ -32,7 +32,8 @@ import {
SEARCH_QWANT,
SEARCH_ENCRYPT,
SEARCH_TAILCAT,
SEARCH_OTHER
SEARCH_OTHER,
DAWN_SETUP_NUMBER_FOR_UNLISTED_OR_RENAMED_SEARCH
} from './ChooseDefaultSearchConstants';
import { Modal } from '../../../../shared-components';

@@ -161,9 +162,15 @@ class ChooseDefaultSearchView extends Component {

setDefaultSearch(chosenSearchName);

const chosenSearchNameIndex = searchSetupNumbers.findIndex(el => el.name === chosenSearchName);

const dawn_setup_number = (chosenSearchNameIndex === -1)
? DAWN_SETUP_NUMBER_FOR_UNLISTED_OR_RENAMED_SEARCH
: searchSetupNumbers[chosenSearchNameIndex].dawn_setup_number;

setSetupStep({
setup_step: CHOOSE_DEFAULT_SEARCH,
dawn_setup_number: searchSetupNumbers.find(elem => elem.name === chosenSearchName).dawn_setup_number,
dawn_setup_number,
origin: ONBOARDING
});
history.push(`/${ONBOARDING}/${CHOOSE_PLAN}`);
ProTip! Use n and p to navigate between commits in a pull request.