tek-wallet 0.0.559 → 0.0.561
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.
|
@@ -204,7 +204,7 @@ function ActivitiesProvider(_a) {
|
|
|
204
204
|
});
|
|
205
205
|
}); }, [isAuthenticated]);
|
|
206
206
|
var loadActivities = (0, react_1.useCallback)(function (slug) { return __awaiter(_this, void 0, void 0, function () {
|
|
207
|
-
var page, response, activitiesLoaded, newActivities;
|
|
207
|
+
var page, response, activitiesLoaded, newActivities, newPage;
|
|
208
208
|
var _a, _b, _c, _d;
|
|
209
209
|
return __generator(this, function (_e) {
|
|
210
210
|
switch (_e.label) {
|
|
@@ -228,24 +228,25 @@ function ActivitiesProvider(_a) {
|
|
|
228
228
|
return [2 /*return*/];
|
|
229
229
|
}
|
|
230
230
|
newActivities = __spreadArray(__spreadArray([], ((_d = activities === null || activities === void 0 ? void 0 : activities[slug]) !== null && _d !== void 0 ? _d : []), true), activitiesLoaded, true);
|
|
231
|
+
newPage = Math.floor(newActivities.length / const_1.ACTIVITIES_PAGE_SIZE);
|
|
231
232
|
setActivities(function (prev) {
|
|
232
233
|
var _a;
|
|
233
234
|
return (__assign(__assign({}, prev), (_a = {}, _a[slug] = newActivities, _a)));
|
|
234
235
|
});
|
|
235
236
|
setPages(function (prev) {
|
|
236
237
|
var _a;
|
|
237
|
-
return (__assign(__assign({}, prev), (_a = {}, _a[slug] =
|
|
238
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[slug] = newPage, _a)));
|
|
238
239
|
});
|
|
239
240
|
return [2 /*return*/];
|
|
240
241
|
}
|
|
241
242
|
});
|
|
242
243
|
}); }, [isAuthenticated, activities, pages]);
|
|
243
244
|
(0, react_1.useEffect)(function () {
|
|
244
|
-
if (
|
|
245
|
+
if (!isAuthenticated)
|
|
245
246
|
return;
|
|
246
247
|
updateActivityTypes();
|
|
247
248
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
248
|
-
}, [isAuthenticated
|
|
249
|
+
}, [isAuthenticated]);
|
|
249
250
|
return ((0, jsx_runtime_1.jsx)(exports.ActivitiesContext.Provider, { value: {
|
|
250
251
|
isLoadingActivities: isLoadingActivities,
|
|
251
252
|
activities: activities,
|