Fix wallet status when wallet is unreachable (#79) #80
Reference in New Issue
Block a user
Delete Branch "fix/79-wallet-status-unavailable"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #79
@@ -43,0 +60,4 @@const checkNwcStatus = async () => {try {await withTimeout(getNwcClient().getInfo(), 5000)Just do
const ok = await Promise.race(getNwcClient().getInfo().then(always("connected")), sleep(5000).then(always("unavailable"))). Replaces 40 lines of code with 4, and it's much easier to follow.@@ -43,0 +112,4 @@if (requestId === walletStatusRequestId) {walletStatus = nextStatus}})()A nice little helper for this pattern is the
callfunction. It's just a little prettier.Merged via
6d99e296Pull request closed