Fix request creation from menu

This commit is contained in:
Gregory Schier
2023-10-26 10:41:14 -07:00
parent d1bc5900fb
commit d62702f7dd
2 changed files with 4 additions and 3 deletions

View File

@@ -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',
});

View File

@@ -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) => {