Skip to content

Commit

Permalink
Fix analytics during import: use Redux action not direct function call
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsnell committed Aug 4, 2020
1 parent 5ec55c2 commit b359787
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/dialogs/import/source-importer/executor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { connect } from 'react-redux';
import { throttle } from 'lodash';

import actions from '../../../../state/actions';
import { recordEvent } from '../../../../state/analytics/middleware';

import PanelTitle from '../../../../components/panel-title';
import TransitionFadeInOut from '../../../../components/transition-fade-in-out';
Expand Down Expand Up @@ -98,6 +97,7 @@ class ImportExecutor extends Component<Props> {
}, 200);
break;
default:
break;
}
});

Expand Down Expand Up @@ -181,7 +181,7 @@ class ImportExecutor extends Component<Props> {

const mapDispatchToProps: S.MapDispatch<DispatchProps> = {
importNote: actions.data.importNote,
recordEvent,
recordEvent: actions.analytics.recordEvent,
};

export default connect(null, mapDispatchToProps)(ImportExecutor);
2 changes: 2 additions & 0 deletions lib/state/actions.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import * as analytics from './analytics/actions';
import * as data from './data/actions';
import * as settings from './settings/actions';
import * as simperium from './simperium/actions';
import * as ui from './ui/actions';

export default {
analytics,
data,
simperium,
settings,
Expand Down
1 change: 0 additions & 1 deletion lib/state/analytics/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const middleware: S.Middleware = (store) => {

return (next) => (action: A.ActionType) => {
const result = next(action);
const nextState = store.getState();

/* catch-all meta used by redux components for these events:
- importer_import_completed
Expand Down

0 comments on commit b359787

Please sign in to comment.