@@ -314,17 +314,28 @@ module.exports = function (doc) {
314314 async function getDashboardItems ( ) {
315315 const me = UI . authn . currentUser ( )
316316 const div = dom . createElement ( 'div' )
317+ const [ books , pods ] = await Promise . all ( [
318+ getAddressBooks ( ) ,
319+ getPods ( )
320+ ] )
317321 return [
318322 { paneName : 'home' , label : 'Your stuff' , icon : UI . icons . iconBase + 'noun_547570.svg' } ,
319323 // TODO: Fix basicPreferences properly then reintroduce when ready
320324 // { paneName: 'basicPreferences', label: 'Preferences', icon: UI.icons.iconBase + 'noun_Sliders_341315_00000.svg' },
321325 { paneName : 'trustedApplications' , label : 'Trusted Apps' , icon : UI . icons . iconBase + 'noun_15177.svg.svg' } ,
322326 { paneName : 'editProfile' , label : 'Edit your profile' , icon : UI . icons . iconBase + 'noun_492246.svg' }
323327 ]
324- . concat ( await getAddressBooks ( ) )
325- . concat ( getPods ( ) )
328+ . concat ( books )
329+ . concat ( pods )
326330
327- function getPods ( ) {
331+ async function getPods ( ) {
332+ try {
333+ // need to make sure that profile is loaded
334+ await kb . fetcher . load ( me . doc ( ) )
335+ } catch ( err ) {
336+ console . error ( 'Unable to load profile' , err )
337+ return [ ]
338+ }
328339 const pods = kb . each ( me , ns . space ( 'storage' ) , null , me . doc ( ) )
329340 return pods . map ( ( pod , index ) => {
330341 let label = pods . length > 1 ? pod . uri . split ( '//' ) [ 1 ] . slice ( 0 , - 1 ) : 'Your storage'
0 commit comments