Skip to content

Commit

Permalink
add hotkey F5 for rescanning
Browse files Browse the repository at this point in the history
  • Loading branch information
tkohlmeier committed Jan 7, 2025
1 parent ba63748 commit 5a4c0cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/Core/SearchWindow/SearchWindowModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class SearchWindowModule {
const settingsManager = moduleRegistry.get("SettingsManager");
const vibrancyProvider = moduleRegistry.get("BrowserWindowVibrancyProvider");
const browserWindowRegistry = moduleRegistry.get("BrowserWindowRegistry");
const ueliCommandInvoker = moduleRegistry.get("UeliCommandInvoker");

const defaultBrowserWindowOptions = new DefaultBrowserWindowConstructorOptionsProvider(
app,
Expand Down Expand Up @@ -124,6 +125,7 @@ export class SearchWindowModule {
});

ipcMain.on("escapePressed", () => shouldHideWindowOnEscapePressed() && browserWindowToggler.hide());
ipcMain.on("rescanExtensionsHotkeyPressed", () => ueliCommandInvoker.invokeUeliCommand("rescanExtensions"));

app.on("second-instance", (_, argv) => {
if (argv.includes("--toggle")) {
Expand Down
4 changes: 4 additions & 0 deletions src/renderer/Core/Search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ export const Search = ({
},
needsToInvokeListener: (keyboardEvent) => keyboardEvent.key === "Enter",
},
{
listener: () => window.ContextBridge.ipcRenderer.send("rescanExtensionsHotkeyPressed"),
needsToInvokeListener: (keyboardEvent) => keyboardEvent.key === "F5",
},
];

for (const eventHandler of eventHandlers) {
Expand Down

0 comments on commit 5a4c0cb

Please sign in to comment.