@ape.swap/bonds-sdk 1.0.395 → 1.0.397
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -133,7 +133,7 @@ var YourBonds = function (_a) {
|
|
|
133
133
|
}, []);
|
|
134
134
|
useEffect(function () {
|
|
135
135
|
var fetchData = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
136
|
-
var results, error_2;
|
|
136
|
+
var results, mappedBills, error_2;
|
|
137
137
|
return __generator(this, function (_a) {
|
|
138
138
|
switch (_a.label) {
|
|
139
139
|
case 0:
|
|
@@ -145,6 +145,11 @@ var YourBonds = function (_a) {
|
|
|
145
145
|
case 2:
|
|
146
146
|
results = _a.sent();
|
|
147
147
|
setUserOwnedBillsData(results);
|
|
148
|
+
mappedBills = results.flat().flatMap(function (results) { return results.userOwnedBills; });
|
|
149
|
+
setMappedUserBills(mappedBills);
|
|
150
|
+
console.log('MAPPEDBILLS');
|
|
151
|
+
console.log(mappedBills);
|
|
152
|
+
console.log('MAPPEDBILLS');
|
|
148
153
|
return [3 /*break*/, 4];
|
|
149
154
|
case 3:
|
|
150
155
|
error_2 = _a.sent();
|
|
@@ -155,14 +160,7 @@ var YourBonds = function (_a) {
|
|
|
155
160
|
});
|
|
156
161
|
}); };
|
|
157
162
|
fetchData();
|
|
158
|
-
|
|
159
|
-
return data.userOwnedBills.map(function (bill) { return bill; });
|
|
160
|
-
});
|
|
161
|
-
setMappedUserBills(mappedBills);
|
|
162
|
-
console.log('MAPPEDBILLS');
|
|
163
|
-
console.log(mappedBills);
|
|
164
|
-
console.log('MAPPEDBILLS');
|
|
165
|
-
}, [account]);
|
|
163
|
+
}, [account, bondData]);
|
|
166
164
|
var _j = useState(null), sortConfig = _j[0], setSortConfig = _j[1];
|
|
167
165
|
var _k = useState(mappedUserBills), sortedBonds = _k[0], setSortedBonds = _k[1];
|
|
168
166
|
var handleSort = function (key) {
|
|
@@ -174,7 +172,7 @@ var YourBonds = function (_a) {
|
|
|
174
172
|
};
|
|
175
173
|
useEffect(function () {
|
|
176
174
|
if (sortConfig === null) {
|
|
177
|
-
var sortedBills = mappedUserBills.sort(function (a, b) {
|
|
175
|
+
var sortedBills = __spreadArray([], mappedUserBills, true).sort(function (a, b) {
|
|
178
176
|
var claimableDifference = parseFloat(claimable(b).toFixed(3)) - parseFloat(claimable(a).toFixed(3));
|
|
179
177
|
if (claimableDifference !== 0) {
|
|
180
178
|
return claimableDifference;
|
|
@@ -149,9 +149,6 @@ export var fetchUserOwnedBillsDataAsync = function (chainId, account, bondData)
|
|
|
149
149
|
});
|
|
150
150
|
return __assign(__assign({}, data), { userOwnedBills: enrichedUserBills });
|
|
151
151
|
});
|
|
152
|
-
console.log("combinedData");
|
|
153
|
-
console.log(combinedData);
|
|
154
|
-
console.log("combinedData");
|
|
155
152
|
return [2 /*return*/, Promise.resolve(combinedData)];
|
|
156
153
|
case 3:
|
|
157
154
|
error_1 = _a.sent();
|