Skip to content

Commit

Permalink
Change into interval and more delay
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrySky committed Mar 24, 2022
1 parent 847b53b commit 88103d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/tray_library/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ export default function Sidebar(props: SidebarProps) {
}, [category, componentList]);

useEffect(() => {
const intervalId = setTimeout(() => {
props.factory.fetchComponentsSignal.emit(componentList);
}, 100); // Send component list to canvas once render or when refresh
return () => clearTimeout(intervalId);
const intervalId = setInterval(async () => {
await props.factory.fetchComponentsSignal.emit(componentList);
}, 300); // Send component list to canvas once render or when refresh
return () => clearInterval(intervalId);
},[componentList, handleRefreshOnClick]);

return (
Expand Down

0 comments on commit 88103d9

Please sign in to comment.