Skip to content

Commit

Permalink
Update client/src/components/Applications/AppForm/AppForm.jsx
Browse files Browse the repository at this point in the history
Co-authored-by: Chandra Y <[email protected]>
  • Loading branch information
tjgrafft and chandra-tacc authored Oct 25, 2023
1 parent e616c08 commit 9bdb5d5
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions client/src/components/Applications/AppForm/AppForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,14 @@ const AdjustValuesWhenQueueChanges = ({ app }) => {

const AppInfo = ({ app }) => {
const categoryDict = useSelector((state) => state.apps.categoryDict);
const getAppCategory = (appId) => {
let category = null;
Object.entries(categoryDict).forEach(([cat, apps]) => {
const getAppCategory = (appId) => {
for (const [cat, apps] of Object.entries(categoryDict)) {
if (apps.some((app) => app.appId === appId)) {
category = cat;
return cat;
}
});
return category;
};
}
return null;
};

const appCategory = getAppCategory(app.definition.id);

Expand Down

0 comments on commit 9bdb5d5

Please sign in to comment.