From 80d28ea2dac4adc696b481f5f52e1f3947d7b959 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Wed, 19 Jun 2024 15:46:53 +0100 Subject: feat(gui): cache zustand store in localstorage (#2168) * fix(gui): use the store to cache week start * feat(gui): cache zustand store in localStorage This means that before we've loaded any data, we can still display something up-to-date. Avoid flashing! I'll probably want to switch this to the tauri sqlite plugin later --- ui/src/App.tsx | 2 +- ui/src/pages/Home.tsx | 10 ++-------- ui/src/state/store.ts | 12 ++++++++++-- 3 files changed, 13 insertions(+), 11 deletions(-) (limited to 'ui') diff --git a/ui/src/App.tsx b/ui/src/App.tsx index 9b5242a7..c643720a 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -105,7 +105,7 @@ function App() {
  • - {user && !user.isLoggedIn() && ( + {user && user.username === "" && !user.username && (