appDisplay: Use _getCategories function instead of duplicating the code

We already have a function which gets the categories of an app and
handles the null-return case, use it.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/799
This commit is contained in:
Jonas Dreßler 2019-11-01 00:19:38 +01:00 committed by Florian Müllner
parent f3eeb94c90
commit c4fa052b03

View File

@ -102,10 +102,7 @@ function _findBestFolderName(apps) {
let commonCategories = []; let commonCategories = [];
appInfos.reduce((categories, appInfo) => { appInfos.reduce((categories, appInfo) => {
const appCategories = appInfo.get_categories(); for (let category of _getCategories(appInfo)) {
if (!appCategories)
return categories;
for (let category of appCategories.split(';')) {
if (!(category in categoryCounter)) if (!(category in categoryCounter))
categoryCounter[category] = 0; categoryCounter[category] = 0;