refactor(global-shortcut): enhance un/register to accept an array, remove un/registerAll (#1117)

* refactor(shell): enhance `un/register` to accept an array, remove `un/registerAll`

closes #1101

* Update lib.rs

* remove permissions, cleanup docs

* bring back unregister_all

* fmt

* fix build

* bundle

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
Amr Bashir
2024-07-08 19:20:00 +03:00
committed by GitHub
parent a66549329c
commit 381a466db3
9 changed files with 101 additions and 123 deletions
+2 -3
View File
@@ -1,9 +1,8 @@
<script>
import { writable } from "svelte/store";
import { writable, get } from "svelte/store";
import {
register as registerShortcut,
unregister as unregisterShortcut,
unregisterAll as unregisterAllShortcuts,
} from "@tauri-apps/plugin-global-shortcut";
export let onMessage;
@@ -35,7 +34,7 @@
}
function unregisterAll() {
unregisterAllShortcuts()
unregisterShortcut(get(shortcuts))
.then(() => {
shortcuts.update(() => []);
onMessage(`Unregistered all shortcuts`);