mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-22 17:39:12 +01:00
Show delete action for duplicate base environments
This commit is contained in:
@@ -184,6 +184,9 @@ function EnvironmentEditDialogSidebar({
|
||||
}
|
||||
|
||||
const singleEnvironment = items.length === 1;
|
||||
const canDeleteEnvironment =
|
||||
isSubEnvironment(environment) ||
|
||||
(isBaseEnvironment(environment) && baseEnvironments.length > 1);
|
||||
|
||||
const menuItems: DropdownItem[] = [
|
||||
{
|
||||
@@ -228,9 +231,7 @@ function EnvironmentEditDialogSidebar({
|
||||
label: 'Delete',
|
||||
hotKeyAction: 'sidebar.selected.delete',
|
||||
hotKeyLabelOnly: true,
|
||||
hidden:
|
||||
(isBaseEnvironment(environment) && baseEnvironments.length <= 1) ||
|
||||
!isSubEnvironment(environment),
|
||||
hidden: !canDeleteEnvironment,
|
||||
leftSlot: <Icon icon="trash" />,
|
||||
onSelect: () => handleDeleteEnvironment(environment),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user