Skip to content

Commit

Permalink
add check if feature exists
Browse files Browse the repository at this point in the history
  • Loading branch information
qdraw committed Feb 22, 2024
1 parent c0be912 commit bdd09fb
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,14 @@ export async function StartMenuOptionDesktopEditorOpenSelection(
setIsError: React.Dispatch<React.SetStateAction<string>>,
messageDesktopEditorUnableToOpen: string,
setModalConfirmationOpenFiles: (value: React.SetStateAction<boolean>) => void,
isReadOnly: boolean
isReadOnly: boolean,
editorEnabled: boolean
) {
if (editorEnabled !== true || isReadOnly) {
return;
}
const toDesktopOpenList = new URLPath().MergeSelectFileIndexItem(select, state.fileIndexItems);
if (!toDesktopOpenList || toDesktopOpenList.length === 0 || isReadOnly) return;
if (!toDesktopOpenList || toDesktopOpenList.length === 0) return;
const selectParams = new URLPath().ArrayToCommaSeparatedStringOneParent(toDesktopOpenList, "");
const urlCheck = new UrlQuery().UrlApiDesktopEditorOpenAmountConfirmationChecker();

Expand Down Expand Up @@ -94,7 +98,7 @@ const MenuOptionDesktopEditorOpenSelection: React.FunctionComponent<IMenuOptionD
: false;

/**
* Open editor with keys
* Open editor with keys - command + e
*/
useHotKeys({ key: "e", ctrlKeyOrMetaKey: true }, () => {
StartMenuOptionDesktopEditorOpenSelection(
Expand All @@ -104,7 +108,8 @@ const MenuOptionDesktopEditorOpenSelection: React.FunctionComponent<IMenuOptionD
setIsError,
MessageDesktopEditorUnableToOpen,
setModalConfirmationOpenFiles,
isReadOnly
isReadOnly,
dataFeatures?.openEditorEnabled === true
).then(() => {
// do nothing
});
Expand Down Expand Up @@ -144,7 +149,8 @@ const MenuOptionDesktopEditorOpenSelection: React.FunctionComponent<IMenuOptionD
setIsError,
MessageDesktopEditorUnableToOpen,
setModalConfirmationOpenFiles,
isReadOnly
isReadOnly,
dataFeatures?.openEditorEnabled === true
)
}
localization={
Expand Down

0 comments on commit bdd09fb

Please sign in to comment.