Skip to content

Commit

Permalink
fix prettier issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianscatularo committed Jul 12, 2023
1 parent 76c06a1 commit 762bc9b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
9 changes: 7 additions & 2 deletions src/hooks/useRedeemControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function parseOriginAsset(originAddress?: string, originChain?: ChainId) {
* @param sourceChain Which chain is the transfer coming from
* @param targetChain Which chain is the transfer going to
* @param originAddress Origin address of the asset
* @param originChain Origin chain of the asset used to calculate
* @param originChain Origin chain of the asset used to calculate
* the asset address or symbol
* @returns a set of warnings, a set of ids and a boolean indicating
* if the transfer is disabled or not
Expand All @@ -39,6 +39,11 @@ export function useRedeemControl(
() => parseOriginAsset(originAddress, originChain) || "",
[originAddress, originChain]
);
const { warnings, ids, isDisabled } = useWarningRulesEngine(rules, sourceChain, targetChain, asset);
const { warnings, ids, isDisabled } = useWarningRulesEngine(
rules,
sourceChain,
targetChain,
asset
);
return { warnings, ids, isRedeemDisabled: isDisabled };
}
13 changes: 9 additions & 4 deletions src/hooks/useTransferControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,19 @@ export function useTransferControl(
targetChain: ChainId,
assetOrToken: string = ""
) {
const [asset, setAsset] = useState<string>(assetOrToken)
const [asset, setAsset] = useState<string>(assetOrToken);
const info = useOriginalAsset(sourceChain, assetOrToken, false);
useEffect(() => {
if (!info.isFetching) {
setAsset(info.data?.originAddress || assetOrToken)
setAsset(info.data?.originAddress || assetOrToken);
}
}, [assetOrToken, info])
const { warnings, ids, isDisabled } = useWarningRulesEngine(rules, sourceChain, targetChain, asset);
}, [assetOrToken, info]);
const { warnings, ids, isDisabled } = useWarningRulesEngine(
rules,
sourceChain,
targetChain,
asset
);
return { warnings, ids, isTransferDisabled: isDisabled };
}

Expand Down

0 comments on commit 762bc9b

Please sign in to comment.