fix: reinitialize api client after server URL changes

This commit is contained in:
Paccoco
2026-05-24 01:53:14 +00:00
parent 674b0d7285
commit 7524cc31c1

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
}