Skip to content

Commit

Permalink
Move to useEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
manhtai committed Sep 5, 2021
1 parent 2026b61 commit 067f675
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,6 @@ const Main = () => {
setSearch(e.target.value);
};

ipcRenderer.on('hotkey-pressed', () => {
history.push('/auto', { auto: true });
});

useEffect(() => {
if (search.trim()) {
setRoutes(
Expand Down Expand Up @@ -223,6 +219,10 @@ const Main = () => {
return null;
})
.catch(console.error);

ipcRenderer.on('hotkey-pressed', () => {
history.push('/auto', { auto: true });
});
}, []);

return (
Expand Down

0 comments on commit 067f675

Please sign in to comment.