diff options
Diffstat (limited to 'src/components/Scoreboard')
-rw-r--r-- | src/components/Scoreboard/Scoreboard.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/components/Scoreboard/Scoreboard.js b/src/components/Scoreboard/Scoreboard.js index 2d9bb80..5c83735 100644 --- a/src/components/Scoreboard/Scoreboard.js +++ b/src/components/Scoreboard/Scoreboard.js @@ -28,18 +28,16 @@ const Scoreboard = () => { const updateSolutions = () => { get('scoreboard/').then(response => { - setTimeout(() => { setSolutions(response.data); - }, 300); }); }; - const removeSolution = (id) => { - setSolutions(solutions.filter((solution => solution.id !== id))); + const removeSolution = id => { + updateSolutions(); }; useEffect(() => { - updateSolutions(); + setTimeout(updateSolutions, 300); }, []); const renderItem = ({ index, style }) => { |