From b49c73de3eded0a39091b24ef638e786500a2d7b Mon Sep 17 00:00:00 2001
From: Ellie Huxtable <ellie@elliehuxtable.com>
Date: Tue, 28 May 2024 16:28:09 +0100
Subject: fix(ui): handle being logged out gracefully (#2052)

* fix(ui): handle being logged out gracefully

* use settings.logged_in
---
 ui/src/pages/Home.tsx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'ui/src/pages/Home.tsx')

diff --git a/ui/src/pages/Home.tsx b/ui/src/pages/Home.tsx
index ce42e0b1..93f2bf93 100644
--- a/ui/src/pages/Home.tsx
+++ b/ui/src/pages/Home.tsx
@@ -68,7 +68,10 @@ export default function Home() {
             stats={[
               {
                 name: "Last Sync",
-                stat: formatRelative(homeInfo.lastSyncTime, new Date()),
+                stat:
+                  (homeInfo.lastSyncTime &&
+                    formatRelative(homeInfo.lastSyncTime, new Date())) ||
+                  "Never",
               },
               {
                 name: "Total history records",
-- 
cgit v1.3.1

