Skip to content

Commit fccfa23

Browse files
gnpricechrisbobbe
authored andcommitted
redux [nfc]: Convert to activeAccountDispatch in notifOpen, too
This is the one other place where we had a comment calling for an `activeAccountDispatch`.
1 parent 067d18d commit fccfa23

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/notification/notifOpen.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ const readInitialNotification = async (): Promise<Notification | null> => {
195195

196196
export const narrowToNotification =
197197
(data: ?Notification): GlobalThunkAction<void> =>
198-
(dispatch, getState) => {
198+
(dispatch, getState, { activeAccountDispatch }) => {
199199
if (!data) {
200200
return;
201201
}
@@ -228,15 +228,7 @@ export const narrowToNotification =
228228
getOwnUserId(state),
229229
);
230230
if (narrow) {
231-
// We have a GlobalDispatch, because this is a global thunk action --
232-
// at the top of the function, we didn't yet know which account was
233-
// intended and had to work that out. But now we know we're working on
234-
// the active account, and want to dispatch a per-account action there.
235-
// For the present, we just use the fact that our GlobalDispatch value
236-
// is the same function as we use for Dispatch.
237-
// TODO(#5006): perhaps have an `activeAccountDispatch: Dispatch` in a
238-
// new GlobalThunkExtras, modeled on ThunkExtras?
239-
(dispatch: $FlowFixMe)(doNarrow(narrow));
231+
activeAccountDispatch(doNarrow(narrow));
240232
}
241233
};
242234

0 commit comments

Comments
 (0)