From d6b5403d175797d8a1eb4c6a34952d7ec2db42dc Mon Sep 17 00:00:00 2001 From: jollygrin Date: Wed, 3 Apr 2024 17:58:04 +0200 Subject: [PATCH] add debug screen --- pages/debug.tsx | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 pages/debug.tsx diff --git a/pages/debug.tsx b/pages/debug.tsx new file mode 100644 index 0000000..ef8d2ec --- /dev/null +++ b/pages/debug.tsx @@ -0,0 +1,34 @@ +import { Navbar } from "@/components/Navbar"; +import { LS_KEY } from "@/lib/hooks"; +import { Box, Button, HStack, Text, VStack } from "@chakra-ui/react"; +import { toast } from "react-hot-toast"; + +export default function DebugPage() { + function clearDecks() { + localStorage.removeItem(LS_KEY.DECKS); + toast.success("Decks cleared"); + } + + function clearMaps() { + localStorage.removeItem(LS_KEY.MAP_LIST); + toast.success("Maps cleared"); + } + return ( + + + + + Debug Screen + + + 99% of the time, isses with the app come from a corrupted localStorage + of your deck or map data. + + + + + + + + ); +}