Skip to content
Snippets Groups Projects
Commit 9e281147 authored by Nico Vermaas's avatar Nico Vermaas
Browse files

blank screen bugfix on login

parent a0750474
No related branches found
No related tags found
1 merge request!49Dev nico
Pipeline #16594 passed
......@@ -22,26 +22,27 @@ export function QueryContextProvider({ children }) {
// this hook executes fetchConfiguration every time that the values between brackets are changed
useEffect(() => {
fetchConfiguration(configName)
if (!fetchConfiguration(configName, {withCredentials: true})) {
fetchConfiguration(configName)
}
}, [api_host, configName]);
//}, [api_host, configName, dplevel, collection]);
function fetchConfiguration(configName) {
function fetchConfiguration(configName, header) {
let configNameString = "";
if (configName) {
configNameString = `?name=${configName}`;
}
axios
.get(api_host + "query/configuration" + configNameString, {withCredentials: true})
.get(api_host + "query/configuration" + configNameString, {header})
.then((response) => {
//alert(configNameString)
let config = response.data["configuration"];
let props = config.query_schema.properties;
console.log("config props: ", props);
console.log("collection value: ", collection);
console.log("dplevel value: ", dplevel);
Object.keys(props).map((key) => {
if (key === "collection" && collection) {
console.log("has key collection, default value is: ", props[key]["default"]);
......@@ -58,7 +59,10 @@ export function QueryContextProvider({ children }) {
.catch((error) => {
let description = ". Configuration not loaded. Is ESAP-API online? " + api_host
console.log(error.toString() + description)
//alert(description)
});
return true
}
console.log("config: ", { config });
......
......@@ -87,7 +87,7 @@ export default function Routes() {
</Switch>
<footer><small>esap-gui version 19 aug 2021 - 8:00</small></footer>
<footer><small>esap-gui version 20 aug 2021 - 10:00</small></footer>
</Router>
);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment