Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
continueGuard(shouldShowConfirmationScreen, confirmAddKeyAlert, (dispatch) => {
// update the state to empty key in order to skip on leave hook
dispatch({ type: KEY_OPENED, payload: createBlankJPadKey() });
// navigate and set defaults
dispatch(push('/keys/_blank'));
dispatch(changeKeyValueType('string'));
const validation = { isValid: false, hint: '', isShowingHint: false };
setImmediate(() => dispatch(updateKeyPath(keyPath, validation)));
});
UNSAFE_componentWillMount() {
const { logged, dispatch } = this.props;
if (logged) {
dispatch(push('/'));
}
}
checkAndRedirect() {
const { dispatch, isAuthenticated } = this.props;
if (!isAuthenticated) {
dispatch(push('/login'));
}
}
return (dispatch) => {
let url = redirectAfterLogin ? `/login?next=${redirectAfterLogin}` : '/login';
if (withReplace) {
dispatch(replace(url));
} else {
dispatch(push(url));
}
};
}
checkExist(props) {
const { doer, dispatch } = props;
if (!doer) dispatch(push('/home'));
}
onStartPlay = () => {
const { dispatch, match, location } = this.props
const { stageName } = match.params
dispatch(push(`/stage/${stageName}${location.search}`))
}
return (dispatch) => {
dispatch({ type: ADD_NEW_IDENTITY, value: { identityType } });
dispatch(push(`/settings/identities/${identityType}`));
};
}
async function (dispatch) {
dispatch(push('/keys/_blank'));
dispatch({ type: KEY_ADDING, payload: key });
};
.then(id => {
dispatch(push(`/edit/${id}`));
dispatch(exportDataSaved());
});
};