From 7524cc31c1321357415a00ec32248fd423cf906a Mon Sep 17 00:00:00 2001 From: Paccoco <99041736+Paccoco@users.noreply.github.com> Date: Sun, 24 May 2026 01:53:14 +0000 Subject: [PATCH] fix: reinitialize api client after server URL changes --- src/utils/ApiClient.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 }