Skip to content

Commit 3605224

Browse files
committed
fixed storage to show content
1 parent deeb322 commit 3605224

2 files changed

Lines changed: 20 additions & 13 deletions

File tree

src/mainPage/menu.ts

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ type MenuItem = {
88
id?: string
99
icon?: string
1010
paneName?: string
11+
subject?: NamedNode
1112
label: string
1213
onclick: () => void | Promise<void>
1314
}
@@ -60,11 +61,13 @@ const getMenuItems = async (subject: NamedNode, outliner: any): Promise<MenuItem
6061
try {
6162
const items = await outliner.getDashboardItems(subject)
6263
return items.map((element) => {
64+
const targetSubject = element.subject || (authn.currentUser() || subject)
6365
return {
6466
icon: element.icon,
67+
subject: targetSubject,
6568
paneName: element.tabName || element.paneName,
6669
label: element.label,
67-
onclick: () => openDashboardPane(subject, outliner, element.tabName || element.paneName)
70+
onclick: () => openDashboardPane(targetSubject, outliner, element.tabName || element.paneName)
6871
}
6972
})
7073
} catch (error) {
@@ -232,15 +235,17 @@ export const createLeftSideMenu = async (subject: NamedNode, outliner: OutlineMa
232235

233236
async function openDashboardPane (subject, outliner: any, pane: string): Promise<void> {
234237
const me = authn.currentUser()
235-
if (me) {
236-
subject = me
237-
} else {
238-
const store = outliner?.context?.store || outliner?.context?.session?.store || outliner?.kb
239-
const fetcher = outliner?.context?.fetcher || store?.fetcher
240-
if (!store || !fetcher) {
241-
throw new Error('Unable to load profile: missing RDF store or fetcher')
238+
if (!subject) {
239+
if (me) {
240+
subject = me
241+
} else {
242+
const store = outliner?.context?.store || outliner?.context?.session?.store || outliner?.kb
243+
const fetcher = outliner?.context?.fetcher || store?.fetcher
244+
if (!store || !fetcher) {
245+
throw new Error('Unable to load profile: missing RDF store or fetcher')
246+
}
247+
subject = await loadProfileFromURI(subject, store, fetcher)
242248
}
243-
subject = await loadProfileFromURI(subject, store, fetcher)
244249
}
245250
outliner.showDashboard(subject, {
246251
pane

src/outline/manager.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,10 +442,12 @@ export default function (context) {
442442
}
443443
// load pod's storages from profile
444444
let pods = kb.each(webId, ns.space('storage'), null, webId.doc())
445-
pods.map(async (pod) => {
446-
// TODO use addPodStorageFromUrl(pod.uri) to check for pim:Storage ???
447-
await loadContainerRepresentation(pod)
448-
})
445+
await Promise.all(
446+
pods.map(async (pod) => {
447+
// TODO use addPodStorageFromUrl(pod.uri) to check for pim:Storage ???
448+
await loadContainerRepresentation(pod)
449+
})
450+
)
449451

450452
try {
451453
// if uri then SolidOS is a browse.html web app

0 commit comments

Comments
 (0)