From ace9efc6876c9452b3a160b21f808a3ff1af36d0 Mon Sep 17 00:00:00 2001 From: Aslam H Date: Wed, 30 Oct 2024 05:51:04 +0700 Subject: [PATCH] fix: missing task --- web/app/components/sidebar/partials/link-collection.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/app/components/sidebar/partials/link-collection.tsx b/web/app/components/sidebar/partials/link-collection.tsx index 06c4b432..6d1cdd5f 100644 --- a/web/app/components/sidebar/partials/link-collection.tsx +++ b/web/app/components/sidebar/partials/link-collection.tsx @@ -1,8 +1,11 @@ import * as React from "react" import { useAccount } from "@/lib/providers/jazz-provider" import { NavItem } from "~/components/custom/nav-item" +import { ListOfTasks } from "~/lib/schema" export const LinkCollection: React.FC = () => { + // will delete soon after do the versioning + const { me: tempMe } = useAccount() const { me } = useAccount({ root: { personalLinks: [], @@ -14,6 +17,10 @@ export const LinkCollection: React.FC = () => { }, }) + if (!tempMe.root?.tasks) { + tempMe.root!.tasks = ListOfTasks.create([], { owner: tempMe }) + } + const linkCount = me?.root.personalLinks?.length || 0 const pageCount = me?.root.personalPages?.length || 0 const taskCount = me?.root.tasks?.length || 0