diff --git a/package-lock.json b/package-lock.json
index 0340619..6d9f3a0 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@quibbble/boardgame",
- "version": "1.1.1",
+ "version": "1.1.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@quibbble/boardgame",
- "version": "1.1.1",
+ "version": "1.1.2",
"license": "MIT",
"devDependencies": {
"@tailwindcss/typography": "^0.5.10",
diff --git a/package.json b/package.json
index e2ad9cc..96e5789 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "@quibbble/boardgame",
"private": false,
- "version": "1.1.1",
+ "version": "1.1.2",
"description": "React component library for Quibbble boardgames.",
"main": "dist/index.umd.js",
"module": "dist/index.mjs",
diff --git a/src/components/DownPage/DownPage.jsx b/src/components/DownPage/DownPage.jsx
index 419acfc..19c51b4 100644
--- a/src/components/DownPage/DownPage.jsx
+++ b/src/components/DownPage/DownPage.jsx
@@ -1,4 +1,4 @@
-import React from "react";
+import React, { useEffect } from "react";
import { useNavigate } from "react-router-dom";
import { Footer } from "../Footer"
import { Health } from "../../api/API";
@@ -7,13 +7,18 @@ export function DownPage({ config }) {
const navigate = useNavigate();
- setInterval(function () {
- async function fetchHealth() {
+ useEffect(() => {
+ const checkHealth = async () => {
let response = await Health(config.host);
if (response && response.status === 200) navigate(`/`);
}
- fetchHealth()
- }, 5000);
+ checkHealth();
+
+ const interval = setInterval(async () => {
+ checkHealth();
+ }, 10000);
+ return () => clearInterval(interval);
+ }, [navigate]);
return (
diff --git a/src/components/HomePage/HomePage.jsx b/src/components/HomePage/HomePage.jsx
index 04fbc19..52efce8 100644
--- a/src/components/HomePage/HomePage.jsx
+++ b/src/components/HomePage/HomePage.jsx
@@ -15,12 +15,17 @@ export function HomePage({ config }) {
const [variant, setVariant] = useState(config.variants.length > 0 ? config.variants[0] : null)
useEffect(() => {
- async function fetchHealth() {
+ const checkHealth = async () => {
let response = await Health(config.host);
if (!response || response.status !== 200) navigate(`/status/down`);
}
- fetchHealth()
- }, [history])
+ checkHealth();
+
+ const interval = setInterval(async () => {
+ checkHealth();
+ }, 10000);
+ return () => clearInterval(interval);
+ }, [navigate]);
async function handleGo(e) {
e.preventDefault();
diff --git a/src/util/adjectives.js b/src/util/adjectives.js
index 6aa9a91..cec1fbc 100644
--- a/src/util/adjectives.js
+++ b/src/util/adjectives.js
@@ -659,7 +659,6 @@ export const Adjectives = [
"proof",
"prosy",
"proud",
- "pubic",
"pudgy",
"puff",
"puffy",