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).
This commit is contained in:
Manav Rathi 2024-05-27 14:41:32 +05:30
parent 04be2b6a2c
commit 9f58f1eeb3
No known key found for this signature in database

View file

@ -153,12 +153,12 @@ const Title_ = styled("div")`
`;
interface WatchList {
watches: FolderWatch[];
watches: FolderWatch[] | undefined;
removeWatch: (watch: FolderWatch) => void;
}
const WatchList: React.FC<WatchList> = ({ watches, removeWatch }) => {
return watches.length === 0 ? (
return (watches ?? []).length === 0 ? (
<NoWatches />
) : (
<WatchesContainer>