A frontend for your PDS

fix: update account display logic to show latest visible account

tophhie.cloud 472598ec e59259bf

verified
+6 -2
+6 -2
src/App.svelte
··· 24 24 let heatmapData: Record<string, number> = {}; 25 25 let year = new Date().getFullYear(); 26 26 let accountsData: any[] = []; 27 + $: latestVisibleAccount = accountsData 28 + ?.slice() 29 + .reverse() 30 + .find(a => a?.hiddenFromHomepage !== true); 27 31 let accountsError: Error | null = null; 28 32 let accountsLoaded = false; 29 33 ··· 155 159 <Heatmap data={heatmapData} {year} lday={false} lmonth={window.innerWidth >= 768} /> 156 160 </div> 157 161 {/if} 158 - {#if accountsLoaded} 159 - <AccountComponent account={accountsData[accountsData.length - 1]} welcome /> 162 + {#if accountsLoaded && latestVisibleAccount} 163 + <AccountComponent account={latestVisibleAccount} welcome /> 160 164 {/if} 161 165 {#each posts as postObject} 162 166 <PostComponent post={postObject as Post} />