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
|
* @todo add gPRC to backend and front end add connect to synology drive
|
||||||
*/
|
*/
|
||||||
const getSponsors = async () => {
|
const getSponsors = async () => {
|
||||||
const res = await fetch(sponsorData);
|
|
||||||
const rawText = await res.text();
|
|
||||||
const yamlDict = yaml.load(rawText);
|
|
||||||
try {
|
try {
|
||||||
let res = yamlDict;
|
const res = await fetch(sponsorData);
|
||||||
setSponsorsDict(res);
|
const rawText = await res.text();
|
||||||
|
const yamlDict = yaml.load(rawText);
|
||||||
|
setSponsorsDict(yamlDict);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
//error checking
|
//error checking
|
||||||
console.error("Error recieving data from server:");
|
console.error("Error recieving data from server:");
|
||||||
@ -40,6 +39,7 @@ const OurSponsors = () => {
|
|||||||
|
|
||||||
if (!sponsorsDict) {
|
if (!sponsorsDict) {
|
||||||
//awaiting for a resposne from the backend
|
//awaiting for a resposne from the backend
|
||||||
|
//add loading notification to user
|
||||||
return <p>Loading...</p>;
|
return <p>Loading...</p>;
|
||||||
}
|
}
|
||||||
if (sponsorsDict) {
|
if (sponsorsDict) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user