Skip to content

Commit

Permalink
Apps: update for @aragon/rpc-messenger's new deferred behaviour (#871)
Browse files Browse the repository at this point in the history
  • Loading branch information
sohkai authored May 29, 2019
1 parent 268a4f3 commit 9c2a422
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
12 changes: 5 additions & 7 deletions apps/finance/app/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,9 @@ class App extends React.Component {
}
handleWithdraw = (tokenAddress, recipient, amount, reference) => {
// Immediate, one-time payment
this.props.api.newImmediatePayment(
tokenAddress,
recipient,
amount,
reference
)
this.props.api
.newImmediatePayment(tokenAddress, recipient, amount, reference)
.toPromise() // Don't care about response
this.handleNewTransferClose()
}
handleDeposit = async (tokenAddress, amount, reference) => {
Expand Down Expand Up @@ -72,7 +69,8 @@ class App extends React.Component {
}
}

api.deposit(tokenAddress, amount, reference, intentParams)
// Don't care about response
api.deposit(tokenAddress, amount, reference, intentParams).toPromise()
this.handleNewTransferClose()
}

Expand Down
5 changes: 3 additions & 2 deletions apps/token-manager/app/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ class App extends React.PureComponent {
handleUpdateTokens = ({ amount, holder, mode }) => {
const { api } = this.props

// Don't care about responses
if (mode === 'assign') {
api.mint(holder, amount)
api.mint(holder, amount).toPromise()
}
if (mode === 'remove') {
api.burn(holder, amount)
api.burn(holder, amount).toPromise()
}

this.handleSidepanelClose()
Expand Down
9 changes: 6 additions & 3 deletions apps/voting/app/src/app-logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export function useCreateVoteAction(onDone) {
return useCallback(
question => {
if (api) {
api.newVote(EMPTY_CALLSCRIPT, question)
// Don't care about response
api.newVote(EMPTY_CALLSCRIPT, question).toPromise()
onDone()
}
},
Expand All @@ -50,7 +51,8 @@ export function useVoteAction(onDone) {
const api = useApi()
return useCallback(
(voteId, voteType, executesIfDecided = true) => {
api.vote(voteId, voteType === VOTE_YEA, executesIfDecided)
// Don't care about response
api.vote(voteId, voteType === VOTE_YEA, executesIfDecided).toPromise()
onDone()
},
[api, onDone]
Expand All @@ -62,7 +64,8 @@ export function useExecuteAction(onDone) {
const api = useApi()
return useCallback(
voteId => {
api.executeVote(voteId)
// Don't care about response
api.executeVote(voteId).toPromise()
onDone()
},
[api, onDone]
Expand Down

0 comments on commit 9c2a422

Please sign in to comment.