From 920ad83f520278df6c061c9d3aa499aad8d3fb5a Mon Sep 17 00:00:00 2001 From: Hailong Cui Date: Fri, 22 Mar 2024 14:56:14 +0800 Subject: [PATCH] address review comments Signed-off-by: Hailong Cui --- .../management_section/objects_table/components/table.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx index 1a1df64e3752..56606711db98 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx @@ -243,8 +243,8 @@ export class Table extends PureComponent { if (currentWorkspaceId) { inAppUrl = formatUrlWithWorkspaceId(path, currentWorkspaceId, basePath); } else { - // first workspace user have permission - const [workspaceId] = object.workspaces.filter((wsId) => visibleWsIds.includes(wsId)); + // find first workspace user have permission + const workspaceId = object.workspaces.find((wsId) => visibleWsIds.includes(wsId)); if (workspaceId) { inAppUrl = formatUrlWithWorkspaceId(path, workspaceId, basePath); }