diff --git a/website/src/pages/Index.tsx b/website/src/pages/Index.tsx index 3b1c829..7fcf720 100644 --- a/website/src/pages/Index.tsx +++ b/website/src/pages/Index.tsx @@ -1,4 +1,4 @@ -import { createSignal, onMount } from "solid-js"; +import { createSignal, onMount, Show } from "solid-js"; import BeakerIcon from "../icons/BeakerIcon"; import EyeDropperIcon from "../icons/EyeDropperIcon"; import { Chart, registerables } from "chart.js"; @@ -20,7 +20,7 @@ export default function () { .order("created_at", { ascending: false }) .limit(10); - if (data != null) { + if (data != null && data.length > 0) { const lastItem = data[0]; setSuhu(lastItem.suhu); @@ -117,24 +117,36 @@ export default function () { return (