Commit 1d42903d authored by Max Alekseenko's avatar Max Alekseenko

fix return type

parent 6497cf35
import { useCallback, useRef, useEffect } from 'react'; import { useCallback, useRef, useEffect } from 'react';
import type { PreVerifyContractResponse } from '@blockscout/points-types'; import type { PreSubmitTransactionResponse } from '@blockscout/points-types';
import config from 'configs/app'; import config from 'configs/app';
import useApiFetch from 'lib/api/useApiFetch'; import useApiFetch from 'lib/api/useApiFetch';
...@@ -59,28 +59,28 @@ export default function useRewardsActivity() { ...@@ -59,28 +59,28 @@ export default function useRewardsActivity() {
} catch {} } catch {}
}, [ apiFetch, checkActivityPassQuery.data, apiToken ]); }, [ apiFetch, checkActivityPassQuery.data, apiToken ]);
const trackTransaction = useCallback(async(from: string, to: string) => const trackTransaction = useCallback(async(from: string, to: string) => {
makeRequest('rewards_user_activity_track_tx', { return (
from_address: from, await makeRequest('rewards_user_activity_track_tx', {
to_address: to, from_address: from,
chain_id: config.chain.id ?? '', to_address: to,
}), chain_id: config.chain.id ?? '',
[ makeRequest ], })
); ) as PreSubmitTransactionResponse | undefined;
}, [ makeRequest ]);
const trackTransactionConfirm = useCallback((hash: string, token: string) => const trackTransactionConfirm = useCallback((hash: string, token: string) =>
makeRequest('rewards_user_activity_track_tx_confirm', { tx_hash: hash, token }), makeRequest('rewards_user_activity_track_tx_confirm', { tx_hash: hash, token }),
[ makeRequest ], [ makeRequest ],
); );
const trackContract = useCallback(async(address: string) => { const trackContract = useCallback(async(address: string) =>
return ( makeRequest('rewards_user_activity_track_contract', {
await makeRequest('rewards_user_activity_track_contract', { address,
address, chain_id: config.chain.id ?? '',
chain_id: config.chain.id ?? '', }),
}) [ makeRequest ],
) as PreVerifyContractResponse | undefined; );
}, [ makeRequest ]);
const trackUsage = useCallback((action: string) => { const trackUsage = useCallback((action: string) => {
// check here because this function is called on page load // check here because this function is called on page load
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment