Skip to content

Commit 067f675

Browse files
committed
Move to useEffect
1 parent 2026b61 commit 067f675

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/Main.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,6 @@ const Main = () => {
172172
setSearch(e.target.value);
173173
};
174174

175-
ipcRenderer.on('hotkey-pressed', () => {
176-
history.push('/auto', { auto: true });
177-
});
178-
179175
useEffect(() => {
180176
if (search.trim()) {
181177
setRoutes(
@@ -223,6 +219,10 @@ const Main = () => {
223219
return null;
224220
})
225221
.catch(console.error);
222+
223+
ipcRenderer.on('hotkey-pressed', () => {
224+
history.push('/auto', { auto: true });
225+
});
226226
}, []);
227227

228228
return (

0 commit comments

Comments
 (0)