Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentWillMount() {
const { dispatch, user } = this.props;
if (!user) {
if (process.env.BROWSER) {
dispatch(pushState(null, '/'));
} else {
dispatch(ServerActions.redirect('/'));
}
}
}
componentWillMount() {
const { dispatch, ownUserId } = this.props;
if (ownUserId) {
if (process.env.BROWSER) {
dispatch(pushState(null, '/'));
} else {
dispatch(ServerActions.redirect('/'));
}
}
}
componentWillMount() {
const { dispatch, ownUserId } = this.props;
if (ownUserId) {
if (process.env.BROWSER) {
dispatch(pushState(null, '/'));
} else {
dispatch(ServerActions.redirect('/'));
}
}
}
componentWillMount() {
const { dispatch, ownUserId } = this.props;
if (ownUserId) {
if (process.env.BROWSER) {
dispatch(pushState(null, '/'));
} else {
dispatch(ServerActions.redirect('/'));
}
}
}
componentWillReceiveProps(nextProps) {
const { dispatch } = this.props;
if (nextProps.success && nextProps.ownUserId) {
dispatch(pushState(null, '/'));
}
}
_onSearchFormSubmit = (e) => {
e.preventDefault();
const { dispatch } = this.props;
this.state.formData[PAGE] = 1;
dispatch(pushState(null, '/browse?' + this.convertStateToQuery()));
};
_onSearchFormSubmit = (e) => {
e.preventDefault();
const { dispatch } = this.props;
const trimmedString = this.state.formData[SEARCH_FIELD].trim();
const queryString = qs.stringify(
{ searchString: trimmedString.length !== 0 ? trimmedString : undefined });
dispatch(pushState(null, '/browse?' + queryString));
};
}
componentWillReceiveProps(nextProps) {
if (nextProps.editorData.get('publishSuccess')) {
this.props.dispatch(pushState(null, ('/pub/' + nextProps.slug)));
}
if (!this.state.initialized && nextProps.editorData.getIn(['pubEditData', 'token'])) {
this.initializeEditorData(nextProps.editorData.getIn(['pubEditData', 'token']));
}
},
componentWillReceiveProps(nextProps) {
if (nextProps.journalData.get('createCollectionStatus') === 'created') {
this.props.dispatch(pushState(null, ('/collection/' + nextProps.journalData.get('createCollectionSlug') + '/edit')));
this.props.dispatch(clearCollectionRedirect());
}
},
componentWillReceiveProps(nextProps) {
if (nextProps.editorData.get('publishSuccess')) {
this.props.dispatch(pushState(null, ('/pub/' + nextProps.slug)));
}
if (!this.state.initialized && nextProps.editorData.getIn(['pubEditData', 'token'])) {
this.initializeEditorData(nextProps.editorData.getIn(['pubEditData', 'token']));
}
if (this.props.editorData.get('styleScoped') !== nextProps.editorData.get('styleScoped')) {
const ref = new Firebase(FireBaseURL + this.props.slug + '/editorData/settings' );
ref.update({styleScoped: nextProps.editorData.get('styleScoped')});
}
},