From 8d0ca2c67d3c1a75a2d88c78a74b627fa03a8b42 Mon Sep 17 00:00:00 2001 From: Thomas Zemp Date: Tue, 5 Mar 2024 10:18:19 +0100 Subject: [PATCH] fix: get apiVersion from loginConfig --- .../src/components/ServerVersionProvider.js | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/adapter/src/components/ServerVersionProvider.js b/adapter/src/components/ServerVersionProvider.js index a347fd04..51430e9f 100644 --- a/adapter/src/components/ServerVersionProvider.js +++ b/adapter/src/components/ServerVersionProvider.js @@ -107,11 +107,22 @@ export const ServerVersionProvider = ({ // version is not currently available, minimum for login app if (loginApp) { - setSystemInfoState({ - loading: false, - error: undefined, - systemInfo: { version: '2.41' }, - }) + const requestLogin = get(`${baseUrl}/api/loginConfig`) + requestLogin + .then((loginConfig) => { + setSystemInfoState({ + loading: false, + error: undefined, + systemInfo: { version: loginConfig.apiVersion }, + }) + }) + .catch((e) => { + setSystemInfoState({ + loading: false, + error: e, + systemInfo: undefined, + }) + }) return } const request = get(`${baseUrl}/api/system/info`)