diff --git a/.github/actions/fork-result-label/action.yml b/.github/actions/fork-result-label/action.yml index 28694ffd7d..f52a5dec41 100644 --- a/.github/actions/fork-result-label/action.yml +++ b/.github/actions/fork-result-label/action.yml @@ -10,31 +10,31 @@ inputs: PULL_REQUEST_NUMBER: description: Pull request id required: false - default: "0" + default: '0' runs: - using: "composite" + using: 'composite' steps: - name: delete success label uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 with: - labels: "CI Passed" - number: ${{ inputs.PULL_REQUEST_NUMBER }} + labels: 'CI Passed' + number: ${{ inputs.PULL_REQUEST_NUMBER }} - name: delete fail label uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 with: - labels: "CI Failed" - number: ${{ inputs.PULL_REQUEST_NUMBER }} + labels: 'CI Failed' + number: ${{ inputs.PULL_REQUEST_NUMBER }} - name: adding success label uses: actions-ecosystem/action-add-labels@bd52874380e3909a1ac983768df6976535ece7f8 if: ${{ inputs.SUCCESS == 'true' }} with: - labels: "CI Passed" - number: ${{ inputs.PULL_REQUEST_NUMBER }} - github_token: ${{ inputs.TOKEN }} + labels: 'CI Passed' + number: ${{ inputs.PULL_REQUEST_NUMBER }} + github_token: ${{ inputs.TOKEN }} - name: adding fail label uses: actions-ecosystem/action-add-labels@bd52874380e3909a1ac983768df6976535ece7f8 if: ${{ inputs.SUCCESS == 'false' }} with: - labels: "CI Failed" - number: ${{ inputs.PULL_REQUEST_NUMBER }} - github_token: ${{ inputs.TOKEN }} + labels: 'CI Failed' + number: ${{ inputs.PULL_REQUEST_NUMBER }} + github_token: ${{ inputs.TOKEN }} diff --git a/src/hooks/useReservesHistory.tsx b/src/hooks/useReservesHistory.tsx index ebc57f5fe1..561179b74e 100644 --- a/src/hooks/useReservesHistory.tsx +++ b/src/hooks/useReservesHistory.tsx @@ -81,20 +81,16 @@ export function useReserveRatesHistory(reserveAddress: string, timeRange: Reserv const [error, setError] = useState(false); const [data, setData] = useState([]); + const ratesHistoryApiUrl = currentNetworkConfig?.ratesHistoryApiUrl; + const refetchData = useCallback<() => () => void>(() => { // reset setLoading(true); setError(false); setData([]); - if ( - reserveAddress && - currentNetworkConfig.ratesHistoryApiUrl && - !BROKEN_ASSETS.includes(reserveAddress) - ) { - const cancelable = makeCancelable( - fetchStats(reserveAddress, timeRange, currentNetworkConfig.ratesHistoryApiUrl) - ); + if (reserveAddress && ratesHistoryApiUrl && !BROKEN_ASSETS.includes(reserveAddress)) { + const cancelable = makeCancelable(fetchStats(reserveAddress, timeRange, ratesHistoryApiUrl)); cancelable.promise .then((data: APIResponse[]) => { @@ -120,7 +116,7 @@ export function useReserveRatesHistory(reserveAddress: string, timeRange: Reserv setLoading(false); return () => null; - }, [reserveAddress, timeRange, currentNetworkConfig]); + }, [reserveAddress, timeRange, ratesHistoryApiUrl]); useEffect(() => { const cancel = refetchData();