Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 1668 | Rev 3582 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1668 Rev 2311
Línea 10... Línea 10...
10
  { type, payload }
10
  { type, payload }
11
) => {
11
) => {
12
  switch (type) {
12
  switch (type) {
13
    case notificationActionTypes.ADD_NOTIFICATION: {
13
    case notificationActionTypes.ADD_NOTIFICATION: {
14
      const newNotification = { ...payload, id: uuid() }
14
      const newNotification = { ...payload, id: uuid() }
-
 
15
 
-
 
16
      const alreadyExist = state.notifications.find(
-
 
17
        (notification) => notification.msg === newNotification.msg
-
 
18
      )
-
 
19
 
-
 
20
      if (alreadyExist) return state
-
 
21
 
15
      return {
22
      return {
16
        ...state,
23
        ...state,
17
        notifications: [newNotification, ...state.notifications]
24
        notifications: [newNotification, ...state.notifications]
18
      }
25
      }
19
    }
26
    }