Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1241 from SumOfUs/feature.new-templates
Browse files Browse the repository at this point in the history
Deprecate scroll to consent
  • Loading branch information
eyko committed Aug 23, 2018
2 parents 1bbf95e + dff9c49 commit c9357b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
6 changes: 1 addition & 5 deletions app/javascript/member-facing/backbone/action_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,7 @@ const ActionForm = Backbone.View.extend({

const consentState = this.state().consent;

if (
consentState.mustConsent &&
consentState.isRequiredNew &&
consentState.consented === null
) {
if (consentState.isRequiredNew && consentState.consented === null) {
event.preventDefault();
event.stopPropagation();
this.store.dispatch(showConsentRequired(true));
Expand Down
11 changes: 1 addition & 10 deletions app/javascript/state/consent/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { includes } from 'lodash';
import type { InitialAction } from '../reducers';

export type ConsentState = {
mustConsent: boolean,
previouslyConsented: boolean,
isRequiredExisting: boolean,
isRequiredNew: boolean,
Expand All @@ -15,7 +14,6 @@ export type ConsentState = {
};

const defaultState: ConsentState = {
mustConsent: false,
previouslyConsented: false,
isRequiredNew: false,
isRequiredExisting: false,
Expand Down Expand Up @@ -50,7 +48,6 @@ export default function reducer(
...state,
countryCode: member.country || location.country || '',
previouslyConsented: member.consented || false,
mustConsent: urlParams.req_gdpr === '1',
};
case '@@chmp:consent:change_country':
return {
Expand All @@ -73,10 +70,8 @@ export default function reducer(
return { ...state, modalOpen: action.modalOpen };
case '@@chmp:consent:show_consent_required':
return { ...state, showConsentRequired: action.value };
case '@@chmp:consent:must_consent':
return { ...state, mustConsent: action.value };
case '@@chmp:consent:reset_state':
return { ...defaultState, mustConsent: state.mustConsent };
return defaultState;
default:
return state;
}
Expand Down Expand Up @@ -106,10 +101,6 @@ export function showConsentRequired(value: boolean): Action {
return { type: '@@chmp:consent:show_consent_required', value };
}

export function mustConsent(value: boolean): Action {
return { type: '@@chmp:consent:must_consent', value };
}

// Conditions:
// * selected country is in an affected country
// * user has not previously given consent
Expand Down

0 comments on commit c9357b8

Please sign in to comment.