From 19d1d133aa0ce55733908312f764e037ec5d9957 Mon Sep 17 00:00:00 2001 From: Curry Yang <1019yanglu@gmail.com> Date: Tue, 26 Nov 2024 17:09:35 +0800 Subject: [PATCH] fix: rename workspace --- packages/insomnia/src/ui/components/tabs/tab.tsx | 2 +- packages/insomnia/src/ui/components/tabs/tabList.tsx | 2 +- packages/insomnia/src/ui/context/app/insomnia-tab-context.tsx | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/insomnia/src/ui/components/tabs/tab.tsx b/packages/insomnia/src/ui/components/tabs/tab.tsx index e4035471a25..8d9a2c9fca5 100644 --- a/packages/insomnia/src/ui/components/tabs/tab.tsx +++ b/packages/insomnia/src/ui/components/tabs/tab.tsx @@ -133,7 +133,7 @@ export const InsomniaTab = ({ tab }: { tab: BaseTab }) => { className="outline-none aria-selected:text-[--color-font] aria-selected:bg-[--hl-sm] hover:bg-[--hl-xs]" > {({ isSelected, isHovered }) => ( - +
{renderTabIcon(tab.type)} {tab.name} diff --git a/packages/insomnia/src/ui/components/tabs/tabList.tsx b/packages/insomnia/src/ui/components/tabs/tabList.tsx index 54c9054ebce..4c1c69ddae8 100644 --- a/packages/insomnia/src/ui/components/tabs/tabList.tsx +++ b/packages/insomnia/src/ui/components/tabs/tabList.tsx @@ -119,7 +119,7 @@ export const OrganizationTabList = ({ showActiveStatus = true, currentPage = '' // update project name(for tooltip) updateProjectName?.(doc._id, doc.name); } else if (doc.type === models.workspace.type) { - // update workspace name(for tooltip) + // update workspace name(for tooltip) & update name for workspace tab updateWorkspaceName?.(doc._id, doc.name); } else { updateTabById?.(doc._id, doc.name); diff --git a/packages/insomnia/src/ui/context/app/insomnia-tab-context.tsx b/packages/insomnia/src/ui/context/app/insomnia-tab-context.tsx index 253ca68bd95..ee20784de5f 100644 --- a/packages/insomnia/src/ui/context/app/insomnia-tab-context.tsx +++ b/packages/insomnia/src/ui/context/app/insomnia-tab-context.tsx @@ -236,6 +236,7 @@ export const InsomniaTabProvider: FC = ({ children }) => { return { ...tab, workspaceName: name, + name: tab.id === workspaceId ? name : tab.name, }; } return tab;