From b359787857ed49f644c5f91e1f98fbdd09d4fbef Mon Sep 17 00:00:00 2001 From: Dennis Snell Date: Tue, 4 Aug 2020 18:05:34 -0400 Subject: [PATCH] Fix analytics during import: use Redux action not direct function call --- lib/dialogs/import/source-importer/executor/index.tsx | 4 ++-- lib/state/actions.ts | 2 ++ lib/state/analytics/middleware.ts | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/dialogs/import/source-importer/executor/index.tsx b/lib/dialogs/import/source-importer/executor/index.tsx index bf54840a4..eb16f65ea 100644 --- a/lib/dialogs/import/source-importer/executor/index.tsx +++ b/lib/dialogs/import/source-importer/executor/index.tsx @@ -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'; @@ -98,6 +97,7 @@ class ImportExecutor extends Component { }, 200); break; default: + break; } }); @@ -181,7 +181,7 @@ class ImportExecutor extends Component { const mapDispatchToProps: S.MapDispatch = { importNote: actions.data.importNote, - recordEvent, + recordEvent: actions.analytics.recordEvent, }; export default connect(null, mapDispatchToProps)(ImportExecutor); diff --git a/lib/state/actions.ts b/lib/state/actions.ts index db4c01d1f..dfd9b7a4e 100644 --- a/lib/state/actions.ts +++ b/lib/state/actions.ts @@ -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, diff --git a/lib/state/analytics/middleware.ts b/lib/state/analytics/middleware.ts index 23f6c4476..fdd5139a2 100644 --- a/lib/state/analytics/middleware.ts +++ b/lib/state/analytics/middleware.ts @@ -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