We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35966c3 commit 81f8cb6Copy full SHA for 81f8cb6
src/frontend/state/GlobalState.tsx
@@ -395,11 +395,13 @@ class GlobalState extends PureComponent<Props> {
395
}
396
397
addGameToCustomCategory = (category: string, appName: string) => {
398
- const newCustomCategories = this.state.customCategories
399
-
400
- if (!newCustomCategories[category]) newCustomCategories[category] = []
+ const gamesInCategory = this.state.customCategories[category] || []
+ gamesInCategory.push(appName)
401
402
- newCustomCategories[category].push(appName)
+ const newCustomCategories = {
+ ...this.state.customCategories,
403
+ [category]: gamesInCategory
404
+ }
405
406
this.setState({
407
customCategories: newCustomCategories
0 commit comments