Skip to content

Commit

Permalink
history: handle undefined action
Browse files Browse the repository at this point in the history
  • Loading branch information
incognitojam committed Jul 26, 2023
1 parent 05bf34e commit 3e473aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/actions/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { primeNav, selectDevice, selectRange } from './index';
import { clipsExit, fetchClipsDetails, fetchClipsList } from './clips';

export const onHistoryMiddleware = ({ dispatch, getState }) => (next) => (action) => {
if (action.type === LOCATION_CHANGE && ['POP', 'REPLACE'].includes(action.payload.action)) {
if (action?.type === LOCATION_CHANGE && ['POP', 'REPLACE'].includes(action?.payload?.action)) {
const state = getState();

next(action); // must be first, otherwise breaks history
Expand Down

0 comments on commit 3e473aa

Please sign in to comment.