Skip to content

Commit

Permalink
fix: What if I used 100% of my brain?
Browse files Browse the repository at this point in the history
  • Loading branch information
rexmagnusdavid committed Apr 17, 2024
1 parent 7698dee commit f193f87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/components/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function Alert(props: {
return (
<React.Fragment>
<div className="flex h-14 flex-row items-center rounded-lg bg-red-600">
{headers.length > 0 ? (
{headers.length > 1 ? (
<Title name={name + " (" + (index + 1) + "/" + headers.length + ")"}></Title>
) : (
<Title name={name}></Title>
Expand Down
8 changes: 4 additions & 4 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ export default function Home() {
});
setServiceAlerts(delayData);

if (serviceAlerts.length === 0) {
setIndex(0);
if (serviceData.length > 0) {
setIndex((i) => ((i % serviceData.length) + serviceData.length) % serviceData.length);
} else {
setIndex((i) => ((i % serviceAlerts.length) + serviceAlerts.length) % serviceAlerts.length);
setIndex(0);
}

const routeData: { [key: string]: { [key: string]: string } } = message["routes"];
Expand All @@ -97,7 +97,7 @@ export default function Home() {
console.log("Websocket closing.");
ws.close();
};
}, [serviceAlerts.length]);
}, []);

useEffect(() => {
const loop = setInterval(() => {
Expand Down

0 comments on commit f193f87

Please sign in to comment.