From 9f58f1eeb34f9863a57da6870270ee9cef693800 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Mon, 27 May 2024 14:41:32 +0530 Subject: [PATCH] Fix error on refresh while a folder watch is being set up Notes: From QA > This error mostly happens if i add a watch folder and before watch folders start to upload and i refresh the app. e is undefined in let {watches: e, removeWatch: n} = t; return 0 === e.length ? (0,... Results in Next throwing Application error: a client-side exception has occurred (see the browser console for more information). --- web/apps/photos/src/components/WatchFolder.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/apps/photos/src/components/WatchFolder.tsx b/web/apps/photos/src/components/WatchFolder.tsx index 812f54c6b..e99fbb007 100644 --- a/web/apps/photos/src/components/WatchFolder.tsx +++ b/web/apps/photos/src/components/WatchFolder.tsx @@ -153,12 +153,12 @@ const Title_ = styled("div")` `; interface WatchList { - watches: FolderWatch[]; + watches: FolderWatch[] | undefined; removeWatch: (watch: FolderWatch) => void; } const WatchList: React.FC = ({ watches, removeWatch }) => { - return watches.length === 0 ? ( + return (watches ?? []).length === 0 ? ( ) : (