mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 00:49:58 +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) {
|
||||
return (await this.loadObject(withoutCache))?.shortcuts;
|
||||
}
|
||||
|
||||
async remove() {
|
||||
await IOUtils.remove(this.shortcutsFile);
|
||||
}
|
||||
}
|
||||
|
||||
function zenGetDefaultShortcuts() {
|
||||
|
@ -777,6 +781,10 @@ var gZenKeyboardShortcutsManager = {
|
|||
}
|
||||
},
|
||||
|
||||
async resetAllShortcuts() {
|
||||
await this.loader.remove();
|
||||
},
|
||||
|
||||
async _saveShortcuts() {
|
||||
let json = [];
|
||||
for (shortcut of this._currentShortcutList) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue