Skip to content

Commit

Permalink
fix: avoid duplicate binding hotkey
Browse files Browse the repository at this point in the history
  • Loading branch information
ahonn committed Oct 19, 2022
1 parent 3cbe9b2 commit 9f9ab25
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ function createModel() {
};
}

const registeredHotKeySet = new Set();
function registerHotKey(binding: string) {
if (!binding) {
if (!binding || registeredHotKeySet.has(binding)) {
return;
}

logseq.App.registerCommandShortcut({ binding }, openTaskPanel);
registeredHotKeySet.add(binding);
}

function main() {
Expand Down

0 comments on commit 9f9ab25

Please sign in to comment.