(fix) ui - npm run build fix

This commit is contained in:
ishaan-jaff 2024-02-03 18:03:34 -08:00
parent 61d1a9a0be
commit 9cdf4a5aa8

View file

@ -41,6 +41,7 @@ const ViewKeySpendReport: React.FC<ViewKeySpendReportProps> = ({ token, accessTo
} }
// call keySpendLogsCall and set the data // call keySpendLogsCall and set the data
useEffect(() => {
const fetchData = async () => { const fetchData = async () => {
try { try {
const response = await keySpendLogsCall(accessToken=accessToken, token=token); const response = await keySpendLogsCall(accessToken=accessToken, token=token);
@ -112,11 +113,10 @@ const ViewKeySpendReport: React.FC<ViewKeySpendReportProps> = ({ token, accessTo
// Optionally, update your UI to reflect the error state here as well // Optionally, update your UI to reflect the error state here as well
} }
}; };
useEffect(() => {
// Fetch data only when the token changes
fetchData(); fetchData();
}, [token]); // Dependency array containing the 'token' variable }, [token, accessToken]);