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 metrics bugs GH-1001 and GH-1022 #47

Merged
merged 3 commits into from Apr 30, 2018
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Fixes for GH-1001 and GH-1022
  • Loading branch information
Serge Zarembsky
Serge Zarembsky committed Apr 26, 2018
commit df10b3dd5b08599f5fdec3a9a4f510e3fb3c6ccd
@@ -73,7 +73,6 @@ export default (state = initialState, action) => {
return Object.assign({}, state, updated);
}
case CREATE_ACCOUNT_SUCCESS:
sendMessage('ping', 'create_account_extension');
return Object.assign({}, state, {
logged_in: true,
email: action.data.ClaimEmailAddress,
@@ -110,10 +109,10 @@ export default (state = initialState, action) => {
default:
break;
}
sendMessage('setPanelData', { [action.data.featureName]: !action.data.isEnabled });

This comment has been minimized.

@jsignanini

jsignanini Apr 30, 2018
Member

@zarembsky please add the sendMessage('ping', ...) check and call as a promise returned from the previous sendMessage call to make sure it happens after the panel data has been set.

if (pingName) {
sendMessage('ping', pingName);
}
sendMessage('setPanelData', { [action.data.featureName]: !action.data.isEnabled });
return Object.assign({}, state, { [action.data.featureName]: !action.data.isEnabled });
}
case TOGGLE_EXPANDED: {
@@ -136,86 +136,36 @@ class Metrics {

// Extension Usage
case 'pause':
this._sendReq('pause', ['all', 'daily', 'weekly']);
break;
case 'resume':
this._sendReq('resume', ['all', 'daily', 'weekly']);
break;
case 'trust_site':
this._sendReq('trust_site', ['all', 'daily', 'weekly']);
break;
case 'restrict_site':
this._sendReq('restrict_site', ['all', 'daily', 'weekly']);
break;
case 'live_scan':
this._sendReq('live_scan', ['all', 'daily', 'weekly']);
break;
case 'sign_in':
this._sendReq('sign_in', ['all', 'daily', 'weekly']);
this._sendReq(type, ['all', 'daily', 'weekly']);
break;
// New
case 'list_dash':
this._sendReq('list_dash', ['all', 'daily', 'weekly', 'monthly']); // ??? Why daily, etc?
break;
case 'history_dash':
this._sendReq('history_dash', ['all', 'daily', 'weekly', 'monthly']);
break;
case 'history_learn':
this._sendReq('history_learn', ['all', 'daily', 'weekly', 'monthly']);
break;
case 'performance_dash':
this._sendReq('performance_dash', ['all', 'daily', 'weekly', 'monthly']);
break;
case 'performance_learn':
this._sendReq('performance_learn', ['all', 'daily', 'weekly', 'monthly']);
break;
case 'rewards_dash':
this._sendReq('rewards_dash', ['all', 'daily', 'weekly', 'monthly']);
break;
case 'rewards_learn':
this._sendReq('rewards_learn', ['all', 'daily', 'weekly', 'monthly']);
break;
case 'premium_dash':
this._sendReq('premium_dash', ['all', 'daily', 'weekly', 'monthly']);
break;
case 'premium_learn':
this._sendReq('premium_learn', ['all', 'daily', 'weekly', 'monthly']);
break;
case 'antitrack_on':
this._sendReq('antitrack_on', ['all', 'daily', 'weekly', 'monthly']);
break;
case 'antitrack_off':
this._sendReq('antitrack_off', ['all', 'daily', 'weekly', 'monthly']);
break;
case 'adblock_on':
this._sendReq('adblock_on', ['all', 'daily', 'weekly', 'monthly']);
break;
case 'adblock_off':
this._sendReq('adblock_off', ['all', 'daily', 'weekly', 'monthly']);
break;
case 'smartblock_on':
this._sendReq('smartblock_on', ['all', 'daily', 'weekly', 'monthly']);
break;
case 'smartblock_off':
this._sendReq('smartblock_off', ['all', 'daily', 'weekly', 'monthly']);
break;
case 'pause_snooze':
this._sendReq('pause_snooze', ['all', 'daily', 'weekly', 'monthly']);
break;
case 'viewchange_from_simple':
this._sendReq('viewchange_from_simple', ['all', 'daily', 'weekly', 'monthly']);
break;
case 'viewchange_from_detailed':
this._sendReq('viewchange_from_detailed', ['all', 'daily', 'weekly', 'monthly']);
break;
case 'viewchange_from_expanded':
this._sendReq('viewchange_from_expanded', ['all', 'daily', 'weekly', 'monthly']);
break;
case 'create_account_extension':
this._sendReq('create_account_extension', ['all', 'daily', 'weekly', 'monthly']);
break;
case 'create_account_setup':
this._sendReq('create_account_setup', ['all', 'daily', 'weekly', 'monthly']);
this._sendReq(type, ['all', 'daily', 'weekly', 'monthly']);
break;
// uncaught ping type
default:
ProTip! Use n and p to navigate between commits in a pull request.