Skip to content

Commit

Permalink
Refactor player deletion logic to remove player from UI immediately i…
Browse files Browse the repository at this point in the history
…nstead of reloading the page
  • Loading branch information
fedecarboni7 committed Oct 24, 2024
1 parent 7c1254a commit d110646
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion static/js/script-v1.0.7.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,8 @@ function deletePlayer(button) {
fetch(`/player/${playerId}`, { method: 'DELETE' })
.then(response => response.text())
.then(() => {
location.reload();
container = document.getElementById("players-container");
container.removeChild(button.parentNode.parentNode);
});

updateSelectedCount();
Expand Down

0 comments on commit d110646

Please sign in to comment.