Skip to content

Commit

Permalink
FIX: Reset bug fixed
Browse files Browse the repository at this point in the history
By reseting/restarting a new deck, the reset function corrupted the screen state, thus corrupting application storage as well :|
  • Loading branch information
diogosilverio committed Jan 29, 2018
1 parent 6c3c790 commit 0ab2272
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions components/flashcards/NewDeck.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ class NewDeck extends Component {
deck: {
name: '',
description: '',
difficulty: 0
difficulty: 0,
cards: [],
won: 0,
lost: 0
}
});
}
Expand All @@ -53,7 +56,7 @@ class NewDeck extends Component {
{ cancelable: false });
return;
}

persistDeck(this.state.deck);
this.props.dispatch(newDeck(this.state.deck));

Expand Down

0 comments on commit 0ab2272

Please sign in to comment.