Skip to content

Commit

Permalink
fix(unisat): incorrect optimisation when checking extension loaded (#177
Browse files Browse the repository at this point in the history
)

fix(unisat): incorrect optimisation
  • Loading branch information
Nanosync authored Nov 29, 2023
1 parent 6957b57 commit d38e4f5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/ord-connect/src/utils/unisat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export async function waitForUnisatExtensionReady() {
// eslint-disable-next-line no-await-in-loop
const accounts = await window.unisat.getAccounts();
// Accounts may be empty even though extension is loaded - we need to wait until this API is ready.
return !!accounts && accounts.length > 0;
if (accounts && accounts.length > 0) {
return true;
}
} catch (_) {
// If we reach here, getAccounts never existed. This should never happen.
break;
Expand Down

0 comments on commit d38e4f5

Please sign in to comment.