From 561055d5d6e01d260289ff30d732b82d5c88b5f2 Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Mon, 30 Jan 2023 21:03:27 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20overwriting=20not=20affect?= =?UTF-8?q?ed=20apps=20and=20widgets=20in=20categories=20#665?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Wrappers/Category/useCategoryActions.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/Dashboard/Wrappers/Category/useCategoryActions.tsx b/src/components/Dashboard/Wrappers/Category/useCategoryActions.tsx index 2ea0698ee..7225f3b5d 100644 --- a/src/components/Dashboard/Wrappers/Category/useCategoryActions.tsx +++ b/src/components/Dashboard/Wrappers/Category/useCategoryActions.tsx @@ -200,7 +200,11 @@ export const useCategoryActions = (configName: string | undefined, category: Cat return false; } - return app.area.properties.id !== mainWrapperId; + if (app.area.properties.id === mainWrapperId) { + return false; + } + + return app.area.properties.id === currentItem.id; }; const isWidgetAffectedFilter = (widget: IWidget): boolean => { @@ -212,7 +216,11 @@ export const useCategoryActions = (configName: string | undefined, category: Cat return false; } - return widget.area.properties.id !== mainWrapperId; + if (widget.area.properties.id === mainWrapperId) { + return false; + } + + return widget.area.properties.id === currentItem.id; }; return {