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';
4
4
import { generateLaunchpadSummary } from './launchpadIndicator' ;
5
5
import type { LaunchpadGroup } from './launchpadProvider' ;
6
6
7
- export async function getLaunchpadSummary ( container : Container ) : Promise < LaunchpadSummaryResult > {
7
+ export async function getLaunchpadSummary ( container : Container ) : Promise < LaunchpadSummaryResult | { error : Error } > {
8
8
const result = await container . launchpad . getCategorizedItems ( ) ;
9
- const groups : LaunchpadGroup [ ] = configuration . get ( 'launchpad.indicator.groups' ) ?? [ ] ;
10
9
10
+ if ( result . error != null ) {
11
+ return {
12
+ error : result . error ,
13
+ } ;
14
+ }
15
+
16
+ const groups : LaunchpadGroup [ ] = configuration . get ( 'launchpad.indicator.groups' ) ?? [ ] ;
11
17
return generateLaunchpadSummary ( result . items , groups ) ;
12
18
}
Original file line number Diff line number Diff line change @@ -200,6 +200,13 @@ export class GlLaunchpad extends SignalWatcher(LitElement) {
200
200
201
201
private renderSummary ( summary : LaunchpadSummary | undefined ) {
202
202
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
+
203
210
if ( summary . total === 0 ) {
204
211
return html `< ul class ="menu ">
205
212
< li > You are all caught up!</ li >
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ export interface OverviewFilters {
44
44
export interface GetLaunchpadSummaryRequest {
45
45
[ key : string ] : unknown ;
46
46
}
47
- export type GetLaunchpadSummaryResponse = LaunchpadSummaryResult | undefined ;
47
+ export type GetLaunchpadSummaryResponse = LaunchpadSummaryResult | { error : Error } | undefined ;
48
48
export const GetLaunchpadSummary = new IpcRequest < GetLaunchpadSummaryRequest , GetLaunchpadSummaryResponse > (
49
49
scope ,
50
50
'launchpad/summary' ,
You can’t perform that action at this time.
0 commit comments