From 76d46ec1ba22158d7f38095d49aca170b2cffb48 Mon Sep 17 00:00:00 2001 From: Meier Lukas Date: Thu, 8 Aug 2024 20:53:35 +0200 Subject: [PATCH] refactor: improve variable names --- .../Dashboard/Wrappers/Category/useCategoryActions.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/Dashboard/Wrappers/Category/useCategoryActions.tsx b/src/components/Dashboard/Wrappers/Category/useCategoryActions.tsx index e2362eb38..c666349d1 100644 --- a/src/components/Dashboard/Wrappers/Category/useCategoryActions.tsx +++ b/src/components/Dashboard/Wrappers/Category/useCategoryActions.tsx @@ -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 => { @@ -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