Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
submitSearch: query => dispatch(historyPush({
pathname: `${SEARCH_PATH}?s=${encodeURIComponent(query)}`,
})),
openScanner: () => dispatch(historyPush({
navigate: () => dispatch(historyPush({ pathname: CART_PATH })),
});
navigate: () => dispatch(historyPush({ pathname: CART_PATH })),
});
navigate: (pathname, title) => dispatch(historyPush({
pathname,
state: { title },
})),
});
} = getCurrentRoute(getState());
const forwardState = {
filters: state.filters || null,
parentId: id,
};
if (categoryId) {
dispatch(historyPush({
pathname: `${CATEGORY_PATH}/${categoryId}/filter`,
state: forwardState,
}));
} else if (query.s) {
const queryString = parseObjectToQueryString(query);
dispatch(historyPush({
pathname: `${SEARCH_PATH}/filter${queryString}`,
state: forwardState,
}));
}
};
navigate: currentSlide =>
dispatch(historyPush({
pathname: `${ITEM_PATH}/${bin2hex(props.productId)}/gallery/${currentSlide}`,
})),
});
openCart: () => dispatch(historyPush({ pathname: CART_PATH })),
});
navigate: (pathname, title) => () => dispatch(historyPush({
pathname,
state: { title },
})),
});
export const navigate = params => (dispatch, getState) => {
dispatch(historyPush({
...params,
state: {
...params.state,
preventA11yFocus: isTabBarVisible(getState(), params.pathname),
},
}));
};
navigate: params => dispatch(historyPush(params)),
});