Speed up data loading, make it more lazy

This commit is contained in:
Jon Staab
2024-08-14 09:28:26 -07:00
parent 5bec4531ea
commit d26bac8a42
5 changed files with 49 additions and 76 deletions
+4 -2
View File
@@ -13,7 +13,7 @@
import PrimaryNavItem from "@lib/components/PrimaryNavItem.svelte"
import SpaceAdd from '@app/components/SpaceAdd.svelte'
import {session} from "@app/base"
import {deriveGroupMembership, makeGroupId, getGroup, deriveProfile, qualifiedGroupsById, getGroupNom} from "@app/state"
import {deriveGroupMembership, makeGroupId, loadGroup, deriveProfile, qualifiedGroupsById, splitGroupId} from "@app/state"
import {pushModal} from "@app/modal"
const addSpace = () => pushModal(SpaceAdd)
@@ -27,10 +27,12 @@
const $userGroupsByNom = new Map()
for (const id of $membership?.ids || []) {
const nom = getGroupNom(id)
const [url, nom] = splitGroupId(id)
const group = $qualifiedGroupsById.get(id)
const groups = $userGroupsByNom.get(nom) || []
loadGroup(nom, [url])
if (group) {
groups.push(group)
}