From 0ba7616ea25661cf4830a4a16c76ec08e7845fa2 Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Tue, 29 Aug 2023 11:55:21 +1200 Subject: [PATCH] Prevent empty graphs flickering If `bests` is always an empty array then our logic for detecting zero graphs is wrong. Now when we haven't loaded any data `bests` is undefined instead of [] --- GraphsList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GraphsList.tsx b/GraphsList.tsx index 1ce01d6..3884bca 100644 --- a/GraphsList.tsx +++ b/GraphsList.tsx @@ -16,7 +16,7 @@ import Page from "./Page"; import Settings from "./settings"; export default function GraphsList() { - const [bests, setBests] = useState([]); + const [bests, setBests] = useState(); const [offset, setOffset] = useState(0); const [end, setEnd] = useState(false); const [term, setTerm] = useState("");