Merge pull request #106 from Paccoco/fix/android-custom-server-url-init

fix: reinitialize api client after server URL changes
This commit is contained in:
Mohamad Tarbin
2026-05-25 02:01:02 -04:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

@@ -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
}

View File

@@ -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)