Skip to content

Commit

Permalink
refactor: improve variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
Meierschlumpf committed Aug 8, 2024
1 parent fbc099d commit 76d46ec
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ export const useCategoryActions = (configName: string | undefined, category: Cat
updateConfig(
configName,
(previous) => {
const currentItem = previous.categories.find((x) => x.id === category.id);
const currentItem = previous.categories.find((category) => category.id === category.id);
if (!currentItem) return previous;
// Find the main wrapper
const mainWrapper = previous.wrappers.find((x) => x.position === 0);
const mainWrapper = previous.wrappers.find((wrapper) => wrapper.position === 0);
const mainWrapperId = mainWrapper?.id ?? 'default';

const isAppAffectedFilter = (app: AppType): boolean => {
Expand Down Expand Up @@ -261,8 +261,10 @@ export const useCategoryActions = (configName: string | undefined, category: Cat
})
),
],
categories: previous.categories.filter((x) => x.id !== category.id),
wrappers: previous.wrappers.filter((x) => x.position !== currentItem.position),
categories: previous.categories.filter((category) => category.id !== category.id),
wrappers: previous.wrappers.filter(
(wrapper) => wrapper.position !== currentItem.position
),
};
},
true
Expand Down

0 comments on commit 76d46ec

Please sign in to comment.