From 4f638a1c8d6597b5820f718d0ded76e978155b83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Fournier?= Date: Thu, 29 Feb 2024 13:54:31 +0100 Subject: [PATCH] fix: bad segment edit link (#6390) ## About the changes Fixes a bad link which leads to editing a global segment from project settings mimicking https://github.com/Unleash/unleash/blob/67928209eff0c00c22919007b860de5c3d0119e9/frontend/src/component/segments/EditSegmentButton/EditSegmentButton.tsx#L22-L28 --- .../component/segments/SegmentTable/SegmentTable.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/component/segments/SegmentTable/SegmentTable.tsx b/frontend/src/component/segments/SegmentTable/SegmentTable.tsx index 7a05131c4b..a430ed3df5 100644 --- a/frontend/src/component/segments/SegmentTable/SegmentTable.tsx +++ b/frontend/src/component/segments/SegmentTable/SegmentTable.tsx @@ -57,7 +57,7 @@ export const SegmentTable = () => { return segments; }, [segments, projectId]); - const columns = useMemo(() => getColumns(), []); + const columns = useMemo(() => getColumns(projectId), [projectId]); const { getTableProps, getTableBodyProps, @@ -172,7 +172,7 @@ export const SegmentTable = () => { ); }; -const getColumns = () => [ +const getColumns = (projectId?: string) => [ { id: 'Icon', width: '1%', @@ -191,7 +191,11 @@ const getColumns = () => [ }: any) => ( ),