From e23d331399089202d165cae76c8cce47a9d51600 Mon Sep 17 00:00:00 2001 From: Keith Date: Thu, 1 Aug 2019 17:06:57 +0800 Subject: [PATCH] feat(neuron-ui): hide the top alert on removing the last error message from the notification panel --- packages/neuron-ui/src/states/stateProvider/reducer.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/neuron-ui/src/states/stateProvider/reducer.ts b/packages/neuron-ui/src/states/stateProvider/reducer.ts index 1547ce6a5c..ace3dc160c 100644 --- a/packages/neuron-ui/src/states/stateProvider/reducer.ts +++ b/packages/neuron-ui/src/states/stateProvider/reducer.ts @@ -424,6 +424,10 @@ export const reducer = ( }, notifications: app.notifications.filter(({ timestamp }) => timestamp !== payload), showAllNotifications: app.notifications.length > 1, + showTopAlert: + app.notifications.findIndex(message => message.timestamp === payload) === app.notifications.length - 1 + ? false + : app.showTopAlert, }, } }