Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 1912 Rev 1913
Línea 30... Línea 30...
30
  const labels = useSelector(({ intl }) => intl.labels)
30
  const labels = useSelector(({ intl }) => intl.labels)
Línea 31... Línea 31...
31
 
31
 
32
  const handleAccept = () => {
32
  const handleAccept = () => {
Línea 33... Línea 33...
33
    const enableLoading = isPromise(onAccept)
33
    const enableLoading = isPromise(onAccept)
-
 
34
 
-
 
35
    if (enableLoading) {
-
 
36
      setLoading(true)
-
 
37
      onAccept().finally(() => {
-
 
38
        console.log(loading)
-
 
39
        setLoading(false)
34
 
40
      })
35
    if (!enableLoading) {
-
 
36
      onAccept()
41
    } else {
37
      return
-
 
38
    }
-
 
39
 
-
 
40
    setLoading((state) => !state)
42
      onAccept()
Línea 41... Línea 43...
41
    onAccept().finally(() => setLoading((state) => !state))
43
    }
42
  }
44
  }
43
 
45