Skip to content

Commit

Permalink
refactor(bridge-ui-v2): Create a function to check a condition.
Browse files Browse the repository at this point in the history
  • Loading branch information
xxxigm committed Nov 2, 2023
1 parent 92392b2 commit b9b82f1
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,21 @@
}
}
const _notAllowBridge = () => {
const conditions = [
!$bridgeService,
!$selectedToken,
!$network,
!$destNetwork?.id,
!$account?.address,
]
return conditions.some(Boolean)
}
async function bridge() {
if (!$bridgeService || !$selectedToken || !$network || !$destNetwork?.id || !$account?.address) return;
if (_notAllowBridge()) return;
bridging = true;
try {
const walletClient = await getConnectedWallet($network.id);
Expand Down

0 comments on commit b9b82f1

Please sign in to comment.