diff --git a/src/components/Main.tsx b/src/components/Main.tsx index 1c69811..40fb942 100644 --- a/src/components/Main.tsx +++ b/src/components/Main.tsx @@ -172,10 +172,6 @@ const Main = () => { setSearch(e.target.value); }; - ipcRenderer.on('hotkey-pressed', () => { - history.push('/auto', { auto: true }); - }); - useEffect(() => { if (search.trim()) { setRoutes( @@ -223,6 +219,10 @@ const Main = () => { return null; }) .catch(console.error); + + ipcRenderer.on('hotkey-pressed', () => { + history.push('/auto', { auto: true }); + }); }, []); return (