Skip to content

Instantly share code, notes, and snippets.

@Waltari10 Waltari10/js
Created Dec 3, 2019

Embed
What would you like to do?
componentDidUpdate() {
if (this.state.members === '' || this.state.members === undefined) {
this.props.fetchHousingGovernmentMembers();
}
if (this.state.members !== this.props.members) {
this.setState({ members: this.props.members });
}
const { isEditing, addRequestStatus, editRequestStatus } = this.props;
let editRequest = editRequestStatus ? Object.values(editRequestStatus)[0]: '';
let addRequest = addRequestStatus ? Object.values(addRequestStatus)[0]: '';
const success = isEditing ? editRequest : addRequest;
if (success) {
this.triggerRedirectTimeout();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.