Skip to content

Commit

Permalink
use a combination of queries and event listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
geoknee committed Oct 9, 2023
1 parent 44cb3d0 commit c67e1b7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/payment-proxy-client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,14 @@ export default function App() {

setPaymentChannelId(result.ChannelId);

// nitroClient.PaymentChannelUpdated(result.ChannelId, setPaymentChannelInfo);
// const paymentChannel = await nitroClient?.GetPaymentChannel(
// result.ChannelId
// );
// setPaymentChannelInfo(paymentChannel);
nitroClient.PaymentChannelUpdated(result.ChannelId, setPaymentChannelInfo);

// It's possible the channel updated before we registered the handler above, so
// query the channel once now to get the latest information:

setPaymentChannelInfo(
await nitroClient?.GetPaymentChannel(result.ChannelId)
);

console.timeEnd("Create Payment Channel");
};
Expand Down

0 comments on commit c67e1b7

Please sign in to comment.