fix(hotkeys): preserve hotkeys if changed, and reduce re-rendering (#3635)
This commit is contained in:
1 parent
6c8364835b
commit
94f7cfb08e
4 files changed
+132
-123
No files matched your search
@@ -164,7 +164,7 @@ export default function ModeRoute({
|
||||
|
||||
// Preserve the old array interface for hotkeys
|
||||
const hotkeys = Array.isArray(hotkeyObj) ? hotkeyObj : hotkeyObj?.hotkeys;
|
||||
const hotkeyName = hotkeyObj?.name || 'hotkey-definitions-v2';
|
||||
const hotkeyName = hotkeyObj?.name || 'hotkey-definitions';
|
||||
|
||||
// An undefined dataSourceName implies that the active data source that is already set in the ExtensionManager should be used.
|
||||
if (dataSourceName !== undefined) {
|
||||
|
||||
@@ -425,7 +425,9 @@ function WorkList({
|
||||
availableLanguages,
|
||||
defaultLanguage,
|
||||
onSubmit: state => {
|
||||
i18n.changeLanguage(state.language.value);
|
||||
if (state.language.value !== currentLanguage().value) {
|
||||
i18n.changeLanguage(state.language.value);
|
||||
}
|
||||
hotkeysManager.setHotkeys(state.hotkeyDefinitions);
|
||||
hide();
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user