Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async handleSubmit(values: FormValues, { setSubmitting }: any ) {
if (!(await checkMetaMaskAndWarn(this.props.showNotification))) { return; }
const proposalValues = {...values,
scheme: this.props.scheme.address,
dao: this.props.daoAvatarAddress
};
setSubmitting(false);
await this.props.createProposal(proposalValues);
Analytics.track("Submit Proposal", {
"DAO Address": this.props.daoAvatarAddress,
"Proposal Title": values.title,
"Scheme Address": this.props.scheme.address,
"Scheme Name": this.props.scheme.name
});
this.props.handleClose();
public async handleClickExecute(actionType: string) {
if (!(await checkMetaMaskAndWarn(this.props.showNotification.bind(this)))) { return; }
const { dao, parentPage, proposalState } = this.props;
await this.props.executeProposal(dao.address, proposalState.id, this.props.currentAccountAddress);
Analytics.track("Transition Proposal", {
"DAO Address": dao.address,
"DAO Name": dao.name,
"Origin": parentPage,
"Proposal Hash": proposalState.id,
"Proposal Title": proposalState.title,
"Scheme Address": proposalState.scheme.address,
"Scheme Name": proposalState.scheme.name,
"Type": actionType
});
}