Skip to content

Commit

Permalink
remove unused setAccountName and some more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
codebykat committed Jul 31, 2020
1 parent 982bc40 commit a64785a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
2 changes: 0 additions & 2 deletions lib/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ type DispatchProps = {
createNote: () => any;
focusSearchField: () => any;
openTagList: () => any;
setAccountName: (name: string) => any;
setLineLength: (length: T.LineLength) => any;
setNoteDisplay: (displayMode: T.ListDisplayMode) => any;
setSortType: (sortType: T.SortType) => any;
Expand Down Expand Up @@ -186,7 +185,6 @@ const mapDispatchToProps: S.MapDispatch<DispatchProps> = (dispatch) => {
createNote: () => dispatch(createNote()),
focusSearchField: () => dispatch(actions.ui.focusSearchField()),
openTagList: () => dispatch(toggleNavigation()),
setAccountName: (name) => dispatch(settingsActions.setAccountName(name)),
setLineLength: (length) => dispatch(settingsActions.setLineLength(length)),
setNoteDisplay: (displayMode) =>
dispatch(settingsActions.setNoteDisplay(displayMode)),
Expand Down
1 change: 0 additions & 1 deletion lib/boot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ const run = (
bootWithoutAuth(
(token: string, username: string, createWelcomeNote: boolean) => {
saveAccount(token, username);
analytics.tracks.recordEvent('user_signed_in');
run(token, username, createWelcomeNote);
}
);
Expand Down
10 changes: 4 additions & 6 deletions lib/state/analytics/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ export const middleware: S.Middleware = (store) => {
}

// @todo old events that have not been reimplemented in the rewrite:
// - application_opened
// - application_opened -- we no longer have a preferencesLoaded action

// @todo events that don't have a corresponding action and aren't in redux
// - user_account_created in boot-without-auth.tsx
// - user_signed_in in boot.ts

switch (action.type) {
/* events that map to an action directly */
Expand Down Expand Up @@ -55,8 +54,7 @@ export const middleware: S.Middleware = (store) => {
case 'REMOVE_NOTE_TAG':
analytics.tracks.recordEvent('editor_tag_removed');
break;
// case 'RESTORE_NOTE':
case 'RESTORE_OPEN_NOTE': // @todo we never see RESTORE_NOTE for some reason
case 'RESTORE_OPEN_NOTE':
analytics.tracks.recordEvent('editor_note_restored');
break;
case 'SEARCH':
Expand All @@ -70,6 +68,7 @@ export const middleware: S.Middleware = (store) => {
analytics.tracks.recordEvent('list_trash_viewed');
break;
case 'setAccountName':
// @todo this gets called twice on login
analytics.tracks.recordEvent('user_signed_in');
break;
case 'SHOW_DIALOG':
Expand All @@ -78,8 +77,7 @@ export const middleware: S.Middleware = (store) => {
}
break;
// case 'DELETE_NOTE_FOREVER': @todo not sure if we should track this too?
//case 'TRASH_NOTE':
case 'TRASH_OPEN_NOTE': // @todo we never see TRASH_NOTE for some reason
case 'TRASH_OPEN_NOTE':
analytics.tracks.recordEvent('editor_note_deleted');
break;
case 'TRASH_TAG':
Expand Down

0 comments on commit a64785a

Please sign in to comment.