fix: missing task

This commit is contained in:
Aslam H
2024-10-30 05:51:04 +07:00
parent 5294ade0ab
commit ace9efc687

View File

@@ -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