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

Fixes for Dawn Onboarding toast messages #660

Merged
merged 12 commits into from Jan 21, 2021

Fix toast not clearing after block settings submit

  • Loading branch information
leuryr committed Jan 14, 2021
commit b3d55d1ef3f75ea8d2220ecebd1d82584d5a2ca0
@@ -65,9 +65,11 @@ class BlockSettingsView extends Component {
blockAds, kindsOfTrackers, antiTracking, smartBrowsing
} = this.state;

const { actions } = this.props;
const { setToast } = actions;

// Will only change user settings if all questions are answered
if (blockAds !== null && kindsOfTrackers !== null && antiTracking !== null && smartBrowsing !== null) {
const { actions } = this.props;
const {
setAdBlock, setAntiTracking, setSmartBlocking, setBlockingPolicy, setSetupStep
} = actions;
@@ -92,12 +94,13 @@ class BlockSettingsView extends Component {
break;
}
setBlockingPolicy({ blockingPolicy });
setToast({
toastMessage: '',
toastClass: ''
});
setSetupStep({ setup_step: CHOOSE_DEFAULT_SEARCH, origin: ONBOARDING });
history.push('/onboarding/3');
} else {
const { actions } = this.props;
const { setToast } = actions;

setToast({
toastMessage: t('ghostery_browser_hub_blocking_settings_view_toast_error_message'),
toastClass: 'alert'
ProTip! Use n and p to navigate between commits in a pull request.