Skip to content
Snippets Groups Projects
Commit d978d3d6 authored by Niklas Schrötler's avatar Niklas Schrötler
Browse files

MensaplanPanel: Added handling for failing requests

parent e36e901e
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,7 @@ const MensaplanPanel = (props: {definition: MensaPanelDefinition}) => {
useEffect(() => {
const update = async () => {
try {
// Determine day to fetch for
const now = new Date();
let fetchFor: string;
......@@ -110,6 +111,12 @@ const MensaplanPanel = (props: {definition: MensaPanelDefinition}) => {
setGroupName("Menüs")
}
}
catch (e) {
console.warn("MensaPlan not showing data because", e);
menus.current = [];
specials.current = [];
}
}
update();
const interval = setInterval(update, 1 * 60 * 60 * 1000);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment