Fixed an issue where ERD Open/Save shorcuts were not working on Windows/Linux. #7639

This commit is contained in:
Aditya Toshniwal
2024-07-24 15:11:05 +05:30
parent 70a7c42be1
commit 1d5f5a2067
4 changed files with 207 additions and 1 deletions
@@ -36,6 +36,7 @@ import usePreferences from '../../../../../../preferences/static/js/store';
import pgAdmin from 'sources/pgadmin';
import { styled } from '@mui/material/styles';
import BeforeUnload from './BeforeUnload';
import { isMac } from '../../../../../../static/js/keyboard_shortcuts';
/* Custom react-diagram action for keyboard events */
export class KeyboardShortcutAction extends Action {
@@ -52,7 +53,7 @@ export class KeyboardShortcutAction extends Action {
for(let shortcut_val of shortcut_handlers){
let [key, handler] = shortcut_val;
if(key) {
this.shortcuts[this.shortcutKey(key.alt, key.ctrl_is_meta ? false : key.control, key.shift, Boolean(key.ctrl_is_meta), key.key.key_code)] = handler;
this.shortcuts[this.shortcutKey(key.alt, (isMac() && key.ctrl_is_meta) ? false : key.control, key.shift, isMac() && Boolean(key.ctrl_is_meta), key.key.key_code)] = handler;
}
}
}