Skip to content

Commit b1ea6d5

Browse files
committed
feat(neuron-ui): dismiss pinned top alert if it's related to auto-dismissed notifications
1 parent 9de23cc commit b1ea6d5

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

packages/neuron-ui/src/states/stateProvider/reducer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,10 @@ export const reducer = (
483483
messages: {
484484
...app.messages,
485485
},
486+
showTopAlert: !(
487+
app.notifications[app.notifications.length - 1] &&
488+
app.notifications[app.notifications.length - 1].code === payload
489+
),
486490
notifications: app.notifications.filter(({ code }) => code !== payload),
487491
},
488492
}

packages/neuron-wallet/tests-e2e/tests/notification.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@ export default (app: Application) => {
7979
client.click('button[type=submit]')
8080
await app.waitUntilLoaded()
8181
sleep(4000)
82-
const alertComponent = await client.$('.ms-MessageBar-text')
83-
const msg = await client.elementIdText(alertComponent.value.ELEMENT)
84-
expect(msg.value).toBe(messages.disconnected)
82+
const alertComponent = await client.$('.ms-MessageBar--error')
83+
expect(alertComponent.state).toBe('failure')
8584
})
8685
})
8786
}

0 commit comments

Comments
 (0)