diff --git a/src/contexts/GlobalContext.js b/src/contexts/GlobalContext.js index 719f703bf1596d116b7797623890f4a30badcde0..3be75b913464f8fd5a31622d6d4110a867be8a7e 100644 --- a/src/contexts/GlobalContext.js +++ b/src/contexts/GlobalContext.js @@ -23,7 +23,7 @@ function setProfileState(api_host, }) .catch((error) => { - + alert(error) // when the token is no longer valid, getting with credentials will fail // mark the user as being logged out localStorage.removeItem('esap_logged_in') diff --git a/src/contexts/QueryContext.js b/src/contexts/QueryContext.js index 9aa243a04b09ae247af8c2aa50cfce7ec4cd9cff..911546d4447a567f0d2cba6ec285ee897213a0cd 100644 --- a/src/contexts/QueryContext.js +++ b/src/contexts/QueryContext.js @@ -1,4 +1,5 @@ import React, { createContext, useState, useEffect, useContext } from "react"; +import { Alert } from "react-bootstrap"; import axios from "axios"; import useMap from "../hooks/useMap"; import { GlobalContext } from "./GlobalContext"; @@ -10,7 +11,7 @@ export function QueryContextProvider({ children }) { const queryMap = useMap(); const [formData, setFormData] = useState(); const [page, setPage] = useState(1); - const [url, setURL] = useState("https://uilennest.net/astrobase/data/191231001/3836665.fits"); + const [url, setURL] = useState(""); const [dplevel, setDPLevel] = useState(); const [collection, setCollection] = useState(); const [config, setConfig] = useState(); @@ -45,7 +46,11 @@ export function QueryContextProvider({ children }) { return null; }); setConfig(config); - }); + }) + .catch((error) => { + let description = ". Configuration not loaded. Is ESAP-API online? " + api_host + alert(error.toString() + description) + }); }, [api_host, configName]); //}, [api_host, configName, dplevel, collection]); diff --git a/src/routes/Routes.js b/src/routes/Routes.js index 0ca92ea2d0bd14517a460732527c0cdc04a74c29..d8e28aa971832a1988ad675f876734c130790ed1 100644 --- a/src/routes/Routes.js +++ b/src/routes/Routes.js @@ -72,7 +72,7 @@ export default function Routes() { </Switch> - <footer><small>esap-gui version 12 jul 2021 - 11:00</small></footer> + <footer><small>esap-gui version 13 jul 2021 - 8:00</small></footer> </Router> ); }