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-1179 fix signal type #99

Merged
merged 1 commit into from Jun 12, 2018
Merged
Changes from all commits
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -114,14 +114,14 @@ class OfferCard extends Component {
}
}

sendSignal(actionId, props = this.props) {
sendSignal(actionId, props = this.props, offerSignal = true) {
// Cliqz metrics
const offerId = props.reward.offer_id;
const offerId = offerSignal ? props.reward.offer_id : null;
const message = {
offerId,
actionId,
origin: 'rewards-hotdog-card',
type: (actionId === 'rewards_off') ? 'action-signal' : 'offer-action-signal',
type: !offerSignal ? 'action-signal' : 'offer-action-signal',
};
this.messageBackground('rewardSignal', message);
}
@@ -155,7 +155,7 @@ class OfferCard extends Component {
}

disableRewards() {
this.sendSignal('rewards_off');
this.sendSignal('rewards_off', null, false);
sendMessage('ping', 'rewards_off');
this.messageBackground('rewardsDisabled');
}
@@ -258,7 +258,7 @@ class OfferCard extends Component {
{ this.state.showSettings &&
<div className="rewards-settings-container">
<ClickOutside excludeEl={this.kebabRef} onClickOutside={this.toggleSettings}>
<Settings signal={() => { this.sendSignal('about_ghostery_rewards'); }} disable={this.disableRewardsNotification} />
<Settings signal={() => { this.sendSignal('about_ghostery_rewards', null, false); }} disable={this.disableRewardsNotification} />
</ClickOutside>
</div>
}
@@ -58,9 +58,11 @@ class Rewards {
origin: origin ? `ghostery-${origin}` : 'ghostery',
data: {
action_id: actionId,
offer_id: offerId
}
};
if (type === 'offer-action-signal') {
signal.offer_id = offerId;
}
log('sendSignal: ', signal);
cliqz.modules['offers-v2'].background.actions.processRealEstateMessage(signal);
}
ProTip! Use n and p to navigate between commits in a pull request.