Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 552a043

Browse files
committed
pay: properly execute the resolveSuccess callback on payment success
With this commit, we ensure that the trigger to update the UI upon payment success is actually triggered. Previously, we would simply reference the function rather than calling it directly.
1 parent bf70f2b commit 552a043

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/lightning-core/pay/reducer.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,11 @@ export const actions = {
4848
.then(() => {
4949
const payments = dispatch(actions.sendPayment())
5050
payments.on('data', function(payment) {
51-
}
52-
else {
53-
resolveSuccess
5451
if (payment.payment_error != "") {
5552
// TODO(roasbeef): need to switch and properlu display errors
5653
rejectError({message: "Payment route failure"})
54+
} else {
55+
resolveSuccess()
5756
}
5857
})
5958
payments.on('error', rejectError)
@@ -85,7 +84,7 @@ export const actions = {
8584
}),
8685
subscribePayments: () => ({
8786
[GRPC]: {
88-
method: 'sendPayment',
87+
method: 'subscribePayments',
8988
types: SUBSCRIBE_PAYMENT,
9089
stream: true,
9190
},

0 commit comments

Comments
 (0)