From 060e997754509b9018fc1959c4742e158cfde222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20Matias=CC=8Cko?= Date: Sun, 23 Jun 2024 13:55:13 +0200 Subject: [PATCH] ResourceToggleCreator disabled content button od canceled status --- .../ResourceToggleCreator/ResourceToggleCreator.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Organisms/ResourceToggleCreator/ResourceToggleCreator.tsx b/src/components/Organisms/ResourceToggleCreator/ResourceToggleCreator.tsx index 1c7d1ea..71bbea3 100644 --- a/src/components/Organisms/ResourceToggleCreator/ResourceToggleCreator.tsx +++ b/src/components/Organisms/ResourceToggleCreator/ResourceToggleCreator.tsx @@ -45,7 +45,10 @@ const ResourceToggleCreator: FC = (props) => { } }, [resourceData.content]) - const hasUpdateContent = useMemo(() => !!resourceData.resourceUpdated && !!resourceData.resourceUpdated.content, [resourceData.resourceUpdated]) + const hasUpdateContent = useMemo( + () => !!resourceData.resourceUpdated && (!!resourceData.resourceUpdated.content || resourceData.resourceUpdated.status === 'CANCELED'), + [resourceData.resourceUpdated] + ) const setContentByType = useCallback((content: ResourceContentType) => { if (typeof content === 'object') { @@ -140,6 +143,7 @@ const ResourceToggleCreator: FC = (props) => { attribute: i18n.content, value: (