From be40d96f0e68fa6a549a18c990b84802ea8b91c9 Mon Sep 17 00:00:00 2001 From: darkicewolf50 Date: Wed, 13 Mar 2024 13:22:27 -0600 Subject: [PATCH] fixed try catch added more todos to loading --- src/OurSponsors/OurSponsors.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/OurSponsors/OurSponsors.js b/src/OurSponsors/OurSponsors.js index 2fd3c49..8d278c0 100644 --- a/src/OurSponsors/OurSponsors.js +++ b/src/OurSponsors/OurSponsors.js @@ -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

Loading...

; } if (sponsorsDict) {