mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-05-29 13:31:27 +02:00
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:
@@ -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`);
|
||||
|
||||
Reference in New Issue
Block a user