Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 5411 Rev 5413
Línea -... Línea 1...
-
 
1
/* eslint-disable camelcase */
1
/* eslint-disable react/prop-types */
2
/* eslint-disable react/prop-types */
2
import React, { useEffect, useRef, useState } from 'react'
3
import React, { useEffect, useRef, useState } from 'react'
3
import { connect } from 'react-redux'
4
import { connect } from 'react-redux'
4
import { axios } from '../../../utils'
5
import { axios } from '../../../utils'
5
import CompanyFollowersHelper from '../../../shared/helpers/company-followers-helper/CompanyFollowers'
6
import CompanyFollowersHelper from '../../../shared/helpers/company-followers-helper/CompanyFollowers'
Línea 56... Línea 57...
56
      ? setCurrentTab(TABS.FEEDS)
57
      ? setCurrentTab(TABS.FEEDS)
57
      : setCurrentTab(TABS.INFO)
58
      : setCurrentTab(TABS.INFO)
58
  }, [isFollower])
59
  }, [isFollower])
Línea 59... Línea 60...
59
 
60
 
60
  const fetchAuthorizedLinks = async () => {
-
 
61
    setLoading(true)
61
  const fetchAuthorizedLinks = async () => {
62
    const response = await axios.get(`/company/view/${companyId}`)
62
    const response = await axios.get(`/company/view/${companyId}`)
63
    const resData = response.data;
-
 
64
    (resData)
63
    const resData = response.data
65
    if (resData.success) {
64
    if (resData.success) {
66
      setAuthorizedLinks(resData.data)
65
      setAuthorizedLinks(resData.data)
67
      setFollowers(resData.data.total_followers)
66
      setFollowers(resData.data.total_followers)
68
      if (resData.data.link_unfollow) {
67
      if (resData.data.link_unfollow) {
69
        setIsFollower(true)
68
        setIsFollower(true)
70
        if (shouldSetInitialTab.current) setCurrentTab(TABS.FEEDS)
69
        if (shouldSetInitialTab.current) setCurrentTab(TABS.FEEDS)
71
      } else {
70
      } else {
72
        setIsFollower(false)
71
        setIsFollower(false)
73
      }
72
      }
74
    }
-
 
75
    return setLoading(false)
73
    }
Línea 76... Línea 74...
76
  }
74
  }
77
 
75
 
78
  const handleButtonAction = async (link) => {
76
  const handleButtonAction = async (link) => {