Skip to content

Commit

Permalink
Fix purge of voting redux store on account switch
Browse files Browse the repository at this point in the history
It was listening to accountLoggedOut action that was no longer used for
account switch
  • Loading branch information
slaweet committed Feb 14, 2018
1 parent 0c84a2c commit 755387c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/store/reducers/voting.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const voting = (state = {
});


case actionTypes.accountLoggedOut:
case actionTypes.accountLoading:
return Object.assign({}, state, {
votes: {},
delegates: [],
Expand Down
4 changes: 2 additions & 2 deletions src/store/reducers/voting.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ describe('Reducer: voting(state, action)', () => {
expect(changedState).to.be.equal(state);
});

it('should clean up with action: accountLoggedOut', () => {
it('should clean up with action: accountLoading', () => {
const action = {
type: actionTypes.accountLoggedOut,
type: actionTypes.accountLoading,
};
const state = { votes: cleanVotes, delegates: fullDelegates, refresh: false };
const changedState = voting(state, action);
Expand Down

0 comments on commit 755387c

Please sign in to comment.