on master help sign in
release: use the actual available count for linear
531e112fang
src/lib/starRelease.js+2−5
@@ -119,11 +119,8 @@ export async function getLinear(contracts, address) {
119 const batch = await linearSR.getBatch(contracts, address);
119 const batch = await linearSR.getBatch(contracts, address);
120 const { amount, withdrawn } = batch;
120 const { amount, withdrawn } = batch;
121
121
122− // Contract errors on withdrawing from a user that does not have any
123− const available =
124− amount > 0
125− ? Math.min(await linearSR.getWithdrawLimit(contracts, address), remaining)
122+ const limit = await linearSR.getWithdrawLimit(contracts, address);
126− : 0;
123+ const available = Math.min(limit - withdrawn, remaining);
127
124
128 const total = Math.min(amount, remaining);
125 const total = Math.min(amount, remaining);
129
126