mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 21:09:58 +02:00
Refactor ZenKeyboardShortcuts to use async/await for initialization and handle potential error when retrieving active workspace from cache
This commit is contained in:
parent
06bff7da09
commit
b4b3c1f0d4
1 changed files with 4 additions and 6 deletions
|
@ -191,7 +191,7 @@ class KeyShortcutModifiers {
|
|||
}
|
||||
|
||||
return new KeyShortcutModifiers(
|
||||
modifiers['control'] == true,
|
||||
modifiers['ctrl'] == true,
|
||||
modifiers['alt'] == true,
|
||||
modifiers['shift'] == true,
|
||||
modifiers['meta'] == true || modifiers['accel'] == true
|
||||
|
@ -203,8 +203,6 @@ class KeyShortcutModifiers {
|
|||
return new KeyShortcutModifiers(false, false, false, false);
|
||||
}
|
||||
|
||||
console.log(modifiers);
|
||||
|
||||
return new KeyShortcutModifiers(
|
||||
modifiers.includes('control') || modifiers.includes('accel'),
|
||||
modifiers.includes('alt'),
|
||||
|
@ -233,7 +231,7 @@ class KeyShortcutModifiers {
|
|||
toString() {
|
||||
let str = '';
|
||||
if (this.#ctrl) {
|
||||
str += 'control,';
|
||||
str += 'accel,';
|
||||
}
|
||||
if (this.#alt) {
|
||||
str += 'alt,';
|
||||
|
@ -574,11 +572,11 @@ var gZenKeyboardShortcutsManager = {
|
|||
await this._saveShortcuts();
|
||||
},
|
||||
|
||||
getModifiableShortcuts() {
|
||||
async getModifiableShortcuts() {
|
||||
let rv = [];
|
||||
|
||||
if (!this._currentShortcutList) {
|
||||
this._currentShortcutList = this._loadSaved();
|
||||
this._currentShortcutList = await this._loadSaved();
|
||||
}
|
||||
|
||||
for (let shortcut of this._currentShortcutList) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue