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

Prev
Used sendMessageInPromise to ensure that ping goes out after data is …
…set in the background.
  • Loading branch information
Serge Zarembsky
Serge Zarembsky committed Apr 30, 2018
commit fe5503292e9d6afd8ba52e3e0edbaba930258d14
@@ -25,7 +25,7 @@ import {
TOGGLE_CLIQZ_FEATURE,
UPDATE_NOTIFICATION_STATUS
} from '../constants/constants';
import { sendMessage } from '../utils/msg';
import { sendMessage, sendMessageInPromise } from '../utils/msg';

const initialState = {
enable_ad_block: true,
@@ -109,10 +109,11 @@ export default (state = initialState, action) => {
default:
break;
}
sendMessage('setPanelData', { [action.data.featureName]: !action.data.isEnabled });
if (pingName) {
sendMessage('ping', pingName);
}
sendMessageInPromise('setPanelData', { [action.data.featureName]: !action.data.isEnabled }).then(() => {
if (pingName) {
sendMessage('ping', pingName);
}
});
return Object.assign({}, state, { [action.data.featureName]: !action.data.isEnabled });
}
case TOGGLE_EXPANDED: {
ProTip! Use n and p to navigate between commits in a pull request.