From 2e194c7455aceb88199305fbb061f8317799891e Mon Sep 17 00:00:00 2001 From: Kai Vandivier Date: Fri, 23 Feb 2024 20:58:46 +0100 Subject: [PATCH] feat: use deduced baseUrl for app runtime --- adapter/src/components/ServerVersionProvider.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/adapter/src/components/ServerVersionProvider.js b/adapter/src/components/ServerVersionProvider.js index 6dfc87cca..c2cc9d83e 100644 --- a/adapter/src/components/ServerVersionProvider.js +++ b/adapter/src/components/ServerVersionProvider.js @@ -3,6 +3,7 @@ import { getBaseUrlByAppName, setBaseUrlByAppName } from '@dhis2/pwa' import PropTypes from 'prop-types' import React, { useEffect, useState } from 'react' import { get } from '../utils/api.js' +import { getBaseUrl } from '../utils/getBaseUrl.js' import { parseDHIS2ServerVersion, parseVersion } from '../utils/parseVersion.js' import { LoadingMask } from './LoadingMask.js' import { LoginModal } from './LoginModal.js' @@ -150,13 +151,15 @@ export const ServerVersionProvider = ({ const serverVersion = parseDHIS2ServerVersion(systemInfo.version) const realApiVersion = serverVersion.minor + // ultimately, use an absolute URL based on hosted location + const finalBaseUrl = getBaseUrl(baseUrl) return (