diff --git a/src/utils/ApiClient.js b/src/utils/ApiClient.js index 1fa60af..3da4e0a 100644 --- a/src/utils/ApiClient.js +++ b/src/utils/ApiClient.js @@ -17,7 +17,7 @@ class ApiClient { } async init(force = false) { - if (this.initPromise) { + if (this.initPromise && !force) { return this.initPromise } @@ -25,7 +25,9 @@ class ApiClient { return Promise.resolve() } - this.initPromise = this._doInit() + this.initPromise = this._doInit().finally(() => { + this.initPromise = null + }) return this.initPromise } diff --git a/src/views/User/UserPoints.jsx b/src/views/User/UserPoints.jsx index 04cb6df..7ab2dee 100644 --- a/src/views/User/UserPoints.jsx +++ b/src/views/User/UserPoints.jsx @@ -62,7 +62,7 @@ const UserPoints = () => { data: choresHistoryData, isLoading: isChoresHistoryLoading, handleLimitChange: handleChoresHistoryLimitChange, - } = useChoresHistory(7) + } = useChoresHistory(7, true) const { data: userProfile } = useUserProfile() const [selectedUser, setSelectedUser] = useState(userProfile?.id)