Skip to content

Commit

Permalink
safely reduce in get all categories
Browse files Browse the repository at this point in the history
  • Loading branch information
cbartondock committed Jun 22, 2020
1 parent f273260 commit 8d1dbed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/renderer/services/preview.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,8 @@ export class PreviewService {
}

getAllCategories() {
return this.previewData ? Object.entries(this.previewData).map(dir=>Object.entries(dir[1]).map(user=>Object.entries(user[1].apps).map(app=>app[1].steamCategories).reduce((x,y)=>_.union(x,y))).reduce((x,y)=>_.union(x,y))).reduce((x,y)=>_.union(x,y)) : [];
const union = (x: string[],y: string[])=>_.union(x,y);
return this.previewData ? Object.entries(this.previewData).map(dir=>Object.entries(dir[1]).map(user=>Object.entries(user[1].apps).map(app=>app[1].steamCategories).reduce(union,[])).reduce(union,[])).reduce(union,[]) : [];
}

private clearImageCache(settingsOnly: boolean) {
Expand Down

0 comments on commit 8d1dbed

Please sign in to comment.