mirror of
https://github.com/ansible/awx.git
synced 2026-04-10 12:39:22 -02:30
Fix linting error in SubscriptionUsageChart
This commit is contained in:
committed by
Michael Abashian
parent
5f5cd960d5
commit
5a93a519f6
@@ -1,6 +1,5 @@
|
|||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
import { t } from '@lingui/macro';
|
import { t } from '@lingui/macro';
|
||||||
import {
|
import {
|
||||||
Card,
|
Card,
|
||||||
@@ -47,7 +46,7 @@ function SubscriptionUsageChart() {
|
|||||||
const [periodSelection, setPeriodSelection] = useState('year');
|
const [periodSelection, setPeriodSelection] = useState('year');
|
||||||
const userProfile = useUserProfile();
|
const userProfile = useUserProfile();
|
||||||
|
|
||||||
const calculateDateRange = () => {
|
const calculateDateRange = useCallback(() => {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
let date = '';
|
let date = '';
|
||||||
switch (periodSelection) {
|
switch (periodSelection) {
|
||||||
@@ -77,7 +76,7 @@ function SubscriptionUsageChart() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return date;
|
return date;
|
||||||
};
|
}, [periodSelection]);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
isLoading,
|
isLoading,
|
||||||
@@ -89,7 +88,7 @@ function SubscriptionUsageChart() {
|
|||||||
calculateDateRange()
|
calculateDateRange()
|
||||||
);
|
);
|
||||||
return data.data.results;
|
return data.data.results;
|
||||||
}, [periodSelection]),
|
}, [calculateDateRange]),
|
||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user