Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
qdraw committed Feb 22, 2024
1 parent bff1e39 commit d77e74b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ const MenuOptionDesktopEditorOpenSelectionNoSelectWarning: React.FunctionCompone
* Open editor with keys - command + e
*/
useHotKeys({ key: "e", ctrlKeyOrMetaKey: true }, () => {
if (dataFeatures?.openEditorEnabled !== true || isReadOnly || select.length >= 1) return;
if (dataFeatures?.openEditorEnabled !== true || isReadOnly || select.length >= 1) {
return;
}
setIsError("select first");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ describe("ModalDesktopEditorOpenConfirmation", () => {
} as IEnvFeatures
} as IConnectionDefault;

const useHotkeysSpy = jest.spyOn(useHotKeys, "default").mockImplementationOnce(() => {
return { key: "e", ctrlKey: true };
});

const useFetchSpy = jest
.spyOn(useFetch, "default")
.mockImplementationOnce(() => mockGetIConnectionDefaultFeatureToggle);

const useHotkeysSpy = jest.spyOn(useHotKeys, "default").mockImplementationOnce(() => {
return { key: "e", ctrlKey: true };
});

const component = render(
<MenuOptionDesktopEditorOpenSelection
isReadOnly={false}
Expand Down

0 comments on commit d77e74b

Please sign in to comment.