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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user