Skip to content

Commit 396e12f

Browse files
chore: error messages
1 parent 88d7f4f commit 396e12f

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

src/app/home/WithdrawRepay/WithdrawRepay.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,20 +137,16 @@ const WithdrawRepay: React.FC<WithdrawRepayProps> = ({
137137
};
138138

139139
const handleSubmit = () => {
140-
if (!inputValue) return;
141-
142-
if (isLoadingOTokenBalance || isLoadingBalance) {
143-
throw new Error("Not loaded userOTokenRate!");
140+
if (!inputValue) {
141+
alert("Please enter an amount to " + mode + ".");
142+
throw new Error("No input amount specified.");
144143
}
145144

146145
const userOTokenRate = Number(oTokenBalance) / Number(lentBalance);
147146

148-
if (!userOTokenRate) {
149-
throw new Error("Not loaded userOTokenRate!");
150-
}
151-
152147
if (!currentBalance) {
153-
throw new Error("Not loaded currentBalance!");
148+
alert("Not loaded currentBalance, please wait a moment and try again.");
149+
throw new Error("Not loaded currentBalance.");
154150
}
155151

156152
let quantity = new Quantity(0n, currentBalance?.denomination).fromString(

0 commit comments

Comments
 (0)