mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-24 04:23:57 +03:00
fix: onEnter creating new function page in settings (#7236)
## Description - This PR solves the issue #7235 - On pressing enter, it automatically redirected to New function page in settings
This commit is contained in:
parent
fa241fa4e9
commit
2fedf0d2fc
@ -8,10 +8,7 @@ import { Table } from '@/ui/layout/table/components/Table';
|
||||
import { TableBody } from '@/ui/layout/table/components/TableBody';
|
||||
import { TableHeader } from '@/ui/layout/table/components/TableHeader';
|
||||
import { TableRow } from '@/ui/layout/table/components/TableRow';
|
||||
import { useScopedHotkeys } from '@/ui/utilities/hotkey/hooks/useScopedHotkeys';
|
||||
import styled from '@emotion/styled';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { Key } from 'ts-key-enum';
|
||||
import { ServerlessFunction } from '~/generated-metadata/graphql';
|
||||
import { useHotkeyScopeOnMount } from '~/hooks/useHotkeyScopeOnMount';
|
||||
|
||||
@ -25,19 +22,11 @@ const StyledTableBody = styled(TableBody)`
|
||||
|
||||
export const SettingsServerlessFunctionsTable = () => {
|
||||
const { serverlessFunctions } = useGetManyServerlessFunctions();
|
||||
const navigate = useNavigate();
|
||||
|
||||
useHotkeyScopeOnMount(
|
||||
SettingsServerlessFunctionHotkeyScope.ServerlessFunction,
|
||||
);
|
||||
|
||||
useScopedHotkeys(
|
||||
[Key.Enter],
|
||||
() => {
|
||||
navigate(getSettingsPagePath(SettingsPath.NewServerlessFunction));
|
||||
},
|
||||
SettingsServerlessFunctionHotkeyScope.ServerlessFunction,
|
||||
);
|
||||
return (
|
||||
<>
|
||||
{serverlessFunctions.length ? (
|
||||
|
Loading…
Reference in New Issue
Block a user