Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #13436 from NejcZdovc/hotfix/#13287-notification
Browse files Browse the repository at this point in the history
Fixes notification shown after toggle
  • Loading branch information
NejcZdovc authored Mar 21, 2018
2 parents a776700 + aad6be4 commit 49ba85c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions app/common/state/ledgerState.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,11 @@ const ledgerState = {
if (paymentId) {
newData = newData.set('paymentId', paymentId)
}

const transactions = ledgerState.getInfoProp(state, 'transactions')
if (transactions) {
newData = newData.set('transactions', transactions)
}
}

return state.setIn(['ledger', 'info'], newData)
Expand Down
14 changes: 12 additions & 2 deletions test/unit/app/common/state/ledgerStateTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ describe('ledgerState unit test', function () {
assert.deepEqual(result.toJS(), expectedState.toJS())
})

it('keep is on, but paymentId is not there', function () {
it('keep is on, but paymentId and transactions are not there', function () {
const state = defaultState.setIn(['ledger', 'info'], Immutable.fromJS({
balance: 10.00
}))
Expand All @@ -518,11 +518,21 @@ describe('ledgerState unit test', function () {
it('keep it', function () {
const state = defaultState.setIn(['ledger', 'info'], Immutable.fromJS({
paymentId: 'a-1-a',
transactions: [
{
votes: 15
}
],
balance: 10.00
}))
const result = ledgerState.resetInfo(state, true)
const expectedState = defaultState.setIn(['ledger', 'info'], Immutable.fromJS({
paymentId: 'a-1-a'
paymentId: 'a-1-a',
transactions: [
{
votes: 15
}
]
}))
assert.deepEqual(result.toJS(), expectedState.toJS())
})
Expand Down

0 comments on commit 49ba85c

Please sign in to comment.