Skip to content

Commit 36c7543

Browse files
committed
fix hasPaymentInfo and paymentInfo
1 parent bb57edc commit 36c7543

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/hooks/useSend.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ export const useSend = () => {
1414
throw new Error("Signer required");
1515
}
1616
}
17-
return (await tx.paymentInfo(signer)).weight.toNumber();
17+
if (tx.hasPaymentInfo) {
18+
return (await tx.paymentInfo(signer)).weight.toNumber();
19+
}
20+
return 0;
1821
};
1922

2023
const checkWeight = async (tx, owner) => {

src/hooks/useSubscription.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export const useSubscription = (initialOwner = null) => {
8686
const DAYS_TO_MS = 24 * 60 * 60 * 1000;
8787

8888
const getFreeWeightCalc = async (owner) => {
89-
const ledger = await getLedger(owner);
89+
const ledger = (await getLedger(owner)).data;
9090
if (!ledger) {
9191
return -1;
9292
}

0 commit comments

Comments
 (0)