mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-24 15:38:07 +00:00
WA-238 Adding callback after changing threshold
This commit is contained in:
parent
d3af885074
commit
ee0165ad28
@ -63,7 +63,7 @@ class GnoSafe extends React.PureComponent<SafeProps, State> {
|
|||||||
onEditThreshold = () => {
|
onEditThreshold = () => {
|
||||||
const { safe } = this.props
|
const { safe } = this.props
|
||||||
|
|
||||||
this.setState({ component: <Threshold numOwners={safe.get('owners').count()} safe={safe} /> })
|
this.setState({ component: <Threshold numOwners={safe.get('owners').count()} safe={safe} onReset={this.onListTransactions} /> })
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
@ -17,6 +17,7 @@ import selector, { type SelectorProps } from './selector'
|
|||||||
type Props = SelectorProps & {
|
type Props = SelectorProps & {
|
||||||
numOwners: number,
|
numOwners: number,
|
||||||
safe: Safe,
|
safe: Safe,
|
||||||
|
onReset: () => void,
|
||||||
}
|
}
|
||||||
|
|
||||||
const THRESHOLD_PARAM = 'threshold'
|
const THRESHOLD_PARAM = 'threshold'
|
||||||
@ -62,13 +63,13 @@ class Threshold extends React.PureComponent<Props, State> {
|
|||||||
const gnosisSafe = await getSafeEthereumInstance(safe.get('address'))
|
const gnosisSafe = await getSafeEthereumInstance(safe.get('address'))
|
||||||
const nonce = Date.now()
|
const nonce = Date.now()
|
||||||
const data = gnosisSafe.contract.changeThreshold.getData(newThreshold)
|
const data = gnosisSafe.contract.changeThreshold.getData(newThreshold)
|
||||||
await createTransaction(safe, "Change Safe's threshold", safe.get('address'), 0, nonce, userAddress, data)
|
await createTransaction(safe, `Change Safe's threshold [${nonce}]`, safe.get('address'), 0, nonce, userAddress, data)
|
||||||
await sleep(1500)
|
await sleep(1500)
|
||||||
// this.props.fetchThreshold(safe.get('address'))
|
// this.props.fetchThreshold(safe.get('address'))
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { numOwners } = this.props
|
const { numOwners, onReset } = this.props
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<GnoForm
|
<GnoForm
|
||||||
@ -82,8 +83,9 @@ class Threshold extends React.PureComponent<Props, State> {
|
|||||||
<Button
|
<Button
|
||||||
variant="raised"
|
variant="raised"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
onClick={submitSucceeded ? onReset : undefined}
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={submitting || submitSucceeded}
|
disabled={submitting}
|
||||||
>
|
>
|
||||||
{ submitSucceeded ? 'VISIT TXs' : 'FINISH' }
|
{ submitSucceeded ? 'VISIT TXs' : 'FINISH' }
|
||||||
</Button>
|
</Button>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user