Skip to content
Snippets Groups Projects
Commit 7ad3b1e2 authored by Lukas's avatar Lukas Committed by mcfarhat
Browse files

Remove refetch from block page

parent d676dba0
No related branches found
No related tags found
1 merge request!602Lbudginas/#497 live data block info bug
Pipeline #119102 failed
......@@ -11,7 +11,6 @@ import {
convertOperationResultsToTableOperations,
} from "@/lib/utils";
import { useUserSettingsContext } from "@/contexts/UserSettingsContext";
import { useHeadBlockNumber } from "@/contexts/HeadBlockContext";
import useBlockData from "@/hooks/api/blockPage/useBlockData";
import useBlockOperations from "@/hooks/api/common/useBlockOperations";
import useOperationsTypes from "@/hooks/api/common/useOperationsTypes";
......@@ -70,7 +69,6 @@ const scrollToTrxSection = (trxId?: string) => {
export default function Block() {
const router = useRouter();
const { blockId } = useBlockId();
const { refetch } = useHeadBlockNumber();
const [blockDate, setBlockDate] = useState<Date>();
const [enableRawVirtualOperations, setEnableRawVirtualOperations] =
......@@ -83,20 +81,16 @@ export default function Block() {
["blockId"]
);
useEffect(() => {
refetch();
}, [blockId, refetch]);
const { settings } = useUserSettingsContext();
const { operationsCountInBlock, countLoading } =
useOperationsCountInBlock(blockId);
const { blockDetails, loading } = useBlockData(blockId);
const { blockDetails, loading } = useBlockData(blockId);
const { rawBlockdata } = useBlockRawData(blockId, enableRawVirtualOperations);
const { blockOperations: totalOperations, trxLoading: totalLoading } =
useBlockOperations(blockId, undefined, paramsState.page || 1);
/* Calculating Maximum Transaction in Blog */
/* Calculating Maximum Transaction in Blog */
let maxTransactions = undefined;
if (
totalOperations?.operations_result &&
......@@ -115,7 +109,6 @@ export default function Block() {
maxTransactions += 1; // Add one since trx_in_block starts at 0 an not 1
}
const { blockError, blockOperations, trxLoading } = useBlockOperations(
blockId,
paramsState.filters
......@@ -148,8 +141,7 @@ export default function Block() {
);
const getOperationsCounts = useCallback(() => {
if(countLoading)
{
if (countLoading) {
return {
virtualOperationsCounter: undefined,
nonVirtualOperationsCounter: undefined,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment