Skip to content

Commit

Permalink
Fix approvals (#2392)
Browse files Browse the repository at this point in the history
  • Loading branch information
Atmosfearful authored Oct 8, 2024
1 parent 6c1490b commit 25f769b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/actions/pklima.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const exerciseTransaction = async (params: {
throw error;
}
params.onStatus("error");
console.error(error);
throw error;
}
};
13 changes: 11 additions & 2 deletions app/components/views/PKlima/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,18 @@ export const PKlima: FC<Props> = (props) => {
};

const hasApproval = (token: "pklima" | "bct") => {
const value = Number(quantity || "0");
if (token === "pklima")
return !!exerciseAllowances && !!Number(exerciseAllowances.pklima);
return !!exerciseAllowances && !!Number(exerciseAllowances.bct);
return (
!!exerciseAllowances &&
!!Number(exerciseAllowances.pklima) &&
Number(exerciseAllowances.pklima) > value
);
return (
!!exerciseAllowances &&
!!Number(exerciseAllowances.bct) &&
Number(exerciseAllowances.bct) > value
);
};

const getButtonProps = () => {
Expand Down

0 comments on commit 25f769b

Please sign in to comment.