Skip to content

Commit

Permalink
Move justCopied toggle timeout inside setState callback
Browse files Browse the repository at this point in the history
  • Loading branch information
chikeichan committed Feb 15, 2019
1 parent 5541cce commit 00ccb19
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ export default class TransactionListItemDetails extends PureComponent {
const { primaryTransaction: transaction } = transactionGroup
const { hash } = transaction

this.setState({ justCopied: true }, () => copyToClipboard(hash))

setTimeout(() => this.setState({ justCopied: false }), 1000)
this.setState({ justCopied: true }, () => {
copyToClipboard(hash)
setTimeout(() => this.setState({ justCopied: false }), 1000)
})
}

render () {
Expand Down

0 comments on commit 00ccb19

Please sign in to comment.