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

Fixes notification shown after toggle #13436

Merged
merged 1 commit into from
Mar 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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