File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
apps/plus/home/components Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,15 @@ import type { LaunchpadSummaryResult } from './launchpadIndicator';
44import { generateLaunchpadSummary } from './launchpadIndicator' ;
55import type { LaunchpadGroup } from './launchpadProvider' ;
66
7- export async function getLaunchpadSummary ( container : Container ) : Promise < LaunchpadSummaryResult > {
7+ export async function getLaunchpadSummary ( container : Container ) : Promise < LaunchpadSummaryResult | { error : Error } > {
88 const result = await container . launchpad . getCategorizedItems ( ) ;
9- const groups : LaunchpadGroup [ ] = configuration . get ( 'launchpad.indicator.groups' ) ?? [ ] ;
109
10+ if ( result . error != null ) {
11+ return {
12+ error : result . error ,
13+ } ;
14+ }
15+
16+ const groups : LaunchpadGroup [ ] = configuration . get ( 'launchpad.indicator.groups' ) ?? [ ] ;
1117 return generateLaunchpadSummary ( result . items , groups ) ;
1218}
Original file line number Diff line number Diff line change @@ -200,6 +200,13 @@ export class GlLaunchpad extends SignalWatcher(LitElement) {
200200
201201 private renderSummary ( summary : LaunchpadSummary | undefined ) {
202202 if ( summary == null ) return nothing ;
203+
204+ if ( 'error' in summary ) {
205+ return html `< ul class ="menu ">
206+ < li > Unable to load items</ li >
207+ </ ul > ` ;
208+ }
209+
203210 if ( summary . total === 0 ) {
204211 return html `< ul class ="menu ">
205212 < li > You are all caught up!</ li >
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ export interface OverviewFilters {
4444export interface GetLaunchpadSummaryRequest {
4545 [ key : string ] : unknown ;
4646}
47- export type GetLaunchpadSummaryResponse = LaunchpadSummaryResult | undefined ;
47+ export type GetLaunchpadSummaryResponse = LaunchpadSummaryResult | { error : Error } | undefined ;
4848export const GetLaunchpadSummary = new IpcRequest < GetLaunchpadSummaryRequest , GetLaunchpadSummaryResponse > (
4949 scope ,
5050 'launchpad/summary' ,
You can’t perform that action at this time.
0 commit comments