mirror of
https://github.com/UofCBaja/BajaUofCWebsite.git
synced 2025-06-15 13:24:17 -06:00
fixed try catch added more todos to loading
This commit is contained in:
parent
23f9511990
commit
be40d96f0e
@ -26,12 +26,11 @@ const OurSponsors = () => {
|
||||
* @todo add gPRC to backend and front end add connect to synology drive
|
||||
*/
|
||||
const getSponsors = async () => {
|
||||
const res = await fetch(sponsorData);
|
||||
const rawText = await res.text();
|
||||
const yamlDict = yaml.load(rawText);
|
||||
try {
|
||||
let res = yamlDict;
|
||||
setSponsorsDict(res);
|
||||
const res = await fetch(sponsorData);
|
||||
const rawText = await res.text();
|
||||
const yamlDict = yaml.load(rawText);
|
||||
setSponsorsDict(yamlDict);
|
||||
} catch (error) {
|
||||
//error checking
|
||||
console.error("Error recieving data from server:");
|
||||
@ -40,6 +39,7 @@ const OurSponsors = () => {
|
||||
|
||||
if (!sponsorsDict) {
|
||||
//awaiting for a resposne from the backend
|
||||
//add loading notification to user
|
||||
return <p>Loading...</p>;
|
||||
}
|
||||
if (sponsorsDict) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user