mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 15:20:00 +02:00
Refactor ZenKeyboardShortcutsLoader to add a new method for removing shortcuts and update the resetAllShortcuts method to use it
This commit is contained in:
parent
53b7f6eecc
commit
028c896112
1 changed files with 8 additions and 0 deletions
|
@ -493,6 +493,10 @@ class ZenKeyboardShortcutsLoader {
|
||||||
async load(withoutCache = false) {
|
async load(withoutCache = false) {
|
||||||
return (await this.loadObject(withoutCache))?.shortcuts;
|
return (await this.loadObject(withoutCache))?.shortcuts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async remove() {
|
||||||
|
await IOUtils.remove(this.shortcutsFile);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function zenGetDefaultShortcuts() {
|
function zenGetDefaultShortcuts() {
|
||||||
|
@ -777,6 +781,10 @@ var gZenKeyboardShortcutsManager = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async resetAllShortcuts() {
|
||||||
|
await this.loader.remove();
|
||||||
|
},
|
||||||
|
|
||||||
async _saveShortcuts() {
|
async _saveShortcuts() {
|
||||||
let json = [];
|
let json = [];
|
||||||
for (shortcut of this._currentShortcutList) {
|
for (shortcut of this._currentShortcutList) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue