Skip to content

Commit

Permalink
ショートカットキーを初期値に戻す際に、衝突チェックを行うようにしました (#1619)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriko0505 authored Oct 25, 2023
1 parent aaf0576 commit e2366a2
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/components/HotkeySettingDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,22 @@ const resetHotkey = async (action: string) => {
.getDefaultHotkeySettings()
.then((defaultSettings: HotkeySetting[]) => {
const setting = defaultSettings.find((value) => value.action == action);
if (setting) {
changeHotkeySettings(action, setting.combination);
if (setting === undefined) {
return;
}
// デフォルトが未設定でない場合は、衝突チェックを行う
if (setting.combination) {
const duplicated = hotkeySettings.value.find(
(item) =>
item.combination == setting.combination && item.action != action
);
if (duplicated !== undefined) {
openHotkeyDialog(action);
lastRecord.value = duplicated.combination;
return;
}
}
changeHotkeySettings(action, setting.combination);
});
}
};
Expand Down

0 comments on commit e2366a2

Please sign in to comment.