Revert the toast display order

New toasts should be displayed immediately.
This commit is contained in:
infinite-persistence 2022-05-06 16:40:34 +08:00 committed by Thomas Zarebczan
parent 463e6f5687
commit 55916f0763
2 changed files with 2 additions and 2 deletions

View file

@ -26,7 +26,7 @@ export default handleActions(
},
[ACTIONS.DISMISS_TOAST]: (state: NotificationState) => {
const newToasts: Array<Toast> = state.toasts.slice();
newToasts.shift();
newToasts.pop();
return {
...state,

View file

@ -31,7 +31,7 @@ export const selectUnseenNotificationCount = createSelector(selectNotifications,
export const selectToast = createSelector(selectState, (state) => {
if (state.toasts.length) {
const { id, params } = state.toasts[0];
const { id, params } = state.toasts[state.toasts.length - 1];
return {
id,
...params,