mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-11 20:00:29 +01:00
Fix request creation from menu
This commit is contained in:
@@ -34,11 +34,12 @@ export const EnvironmentActionsDropdown = memo(function EnvironmentActionsDropdo
|
||||
(e) => ({
|
||||
key: e.id,
|
||||
label: e.name,
|
||||
rightSlot: e.id === activeEnvironment?.id ? <Icon icon="check" /> : undefined,
|
||||
onSelect: async () => {
|
||||
routes.setEnvironment(e);
|
||||
},
|
||||
}),
|
||||
[],
|
||||
[activeEnvironment?.id],
|
||||
);
|
||||
const activeEnvironmentItems: DropdownItem[] =
|
||||
environments.length <= 1
|
||||
@@ -99,7 +100,7 @@ export const EnvironmentActionsDropdown = memo(function EnvironmentActionsDropdo
|
||||
const name = await prompt({
|
||||
name: 'name',
|
||||
label: 'Name',
|
||||
defaultValue: '',
|
||||
defaultValue: 'My Environment',
|
||||
description: 'Enter a name for the new environment',
|
||||
title: 'Create Environment',
|
||||
});
|
||||
|
||||
@@ -51,7 +51,7 @@ export const Sidebar = memo(function Sidebar({ className }: Props) {
|
||||
const [selectedIndex, setSelectedIndex] = useState<number>();
|
||||
|
||||
// TODO: Move these listeners to a central place
|
||||
useListenToTauriEvent('create_request', async () => createRequest.mutate({}));
|
||||
useListenToTauriEvent('new_request', async () => createRequest.mutate({}));
|
||||
|
||||
const focusActiveRequest = useCallback(
|
||||
(forcedIndex?: number) => {
|
||||
|
||||
Reference in New Issue
Block a user