Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleClose() {
browserHistory.push(
`/settlements/${this.props.params.oid}/survivors/${this.props.params
.survivorId}`
);
}
// Handle's the save and makes the API Call
// update store
yield put({
type: USER_LOGGED_IN,
payload: newUser,
})
// change route to newsfeed (or to redirect url)
let currentLocation = browserHistory.getCurrentLocation()
if ('redirect' in currentLocation.query) {
yield browserHistory.push(decodeURIComponent(currentLocation.query.redirect))
} else {
yield browserHistory.push('/newsfeed')
}
} catch (error) {}
} else {
yield browserHistory.push('/signup')
}
}
addActivity(activityData) {
if (activityData.acf.special_content !== 'findrep' && activityData.acf.special_content !== 'elections') {
this.props.addUserActivity(activityData);
browserHistory.push('/');
} else {
switch (activityData.acf.special_content) {
case 'findrep':
this.props.lookForReps(activityData);
browserHistory.push('/find-representative');
break;
case 'elections':
// do something
break;
default:
// do something by default
}
}
}
_yearChanged(event) {
// Reset postion to first page when changing the year
const year = parseInt(event.target.value, 0)
const state = Object.assign({}, this.state, {position: 0, year})
this.setState(state)
// Update history to include the new state
const {location} = this.props
const {key, pathname, query, hash} = location
browserHistory.push({
key, pathname, query, hash, state,
})
}
.then((response) => {
if (response.errors) {
throw new Error(response.errors[0].message);
}
const { slug } = response.data.createPost;
browserHistory.push(`/posts/${slug}`);
})
.catch((error) => this.setState({ error }))
return dispatch => {
dispatch(requestLogout())
localStorage.removeItem('id_token')
localStorage.removeItem('user')
dispatch(receiveLogout())
browserHistory.push('/logout')
}
}
export function* logoutSaga(action) {
const { data } = yield call(auth.logout)
try {
if (data.success) {
yield put({ type: types.LOGOUT_SUCCESS })
browserHistory.push(routes.ACCOUNT_LOGIN)
} else {
yield call(handleError, action, data)
}
} catch (err) {
yield call(handleError, action, err)
}
}
<li> browserHistory.push('/breweries')}>
Breweries</li>
return () => {
history.push(pathname);
};
}
browserHistory.push("/about")}>ABOUT
browserHistory.push("/press")}>PRESS