Skip to content

Commit

Permalink
fix(draftboard): add confirmation dialog when resetting
Browse files Browse the repository at this point in the history
  • Loading branch information
aptmac committed Aug 27, 2022
1 parent 15a1f14 commit 3cb744d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/app/Draftboard/Draftboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,16 @@ class DraftBoard extends Component<any, any> {

reset() {
const players = this.state.players.slice();
players.map((player, i) => {
return (player.drafted = null);
});

this.setState({
currentDraft: 0,
players: players,
});
if (confirm("Are you sure you want to reset your progress?")) {
players.map((player, i) => {
return (player.drafted = null);
});

this.setState({
currentDraft: 0,
players: players,
});
}
}

retrieveData = (data) => {
Expand Down

0 comments on commit 3cb744d

Please sign in to comment.