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

Fix interactions tabs

parent f377b05c
No related branches found
No related tags found
1 merge request!594Lbudginas/#483 interactions tab bug
...@@ -39,8 +39,11 @@ const InteractionsTabContent: React.FC<InteractionsTabContentProps> = ({ ...@@ -39,8 +39,11 @@ const InteractionsTabContent: React.FC<InteractionsTabContentProps> = ({
accountName: accountNameFromRoute, accountName: accountNameFromRoute,
} as any; } as any;
const { commentSearchData, isCommentSearchDataLoading } = const {
useCommentSearch(props); commentSearchData,
isCommentSearchDataLoading,
isCommentSearchDataFetching,
} = useCommentSearch(props);
const buildCommentSearchView = () => { const buildCommentSearchView = () => {
if (!isCommentSearchDataLoading && !commentSearchData?.total_operations) { if (!isCommentSearchDataLoading && !commentSearchData?.total_operations) {
...@@ -49,7 +52,7 @@ const InteractionsTabContent: React.FC<InteractionsTabContentProps> = ({ ...@@ -49,7 +52,7 @@ const InteractionsTabContent: React.FC<InteractionsTabContentProps> = ({
<NoResult /> <NoResult />
</div> </div>
); );
} else if (isCommentSearchDataLoading) { } else if (isCommentSearchDataFetching && isCommentSearchDataLoading) {
return ( return (
<div className="flex justify-center text-center items-center"> <div className="flex justify-center text-center items-center">
<Loader2 className="animate-spin mt-1 text-text h-12 w-12 ml-3 ..." /> <Loader2 className="animate-spin mt-1 text-text h-12 w-12 ml-3 ..." />
...@@ -89,7 +92,7 @@ const InteractionsTabContent: React.FC<InteractionsTabContentProps> = ({ ...@@ -89,7 +92,7 @@ const InteractionsTabContent: React.FC<InteractionsTabContentProps> = ({
</CardHeader> </CardHeader>
<CardContent> <CardContent>
<AccountPageInteractionSearch <AccountPageInteractionSearch
isCommentSearchDataLoading={isCommentSearchDataLoading} isCommentSearchDataLoading={isCommentSearchDataFetching}
/> />
</CardContent> </CardContent>
</Card> </Card>
......
...@@ -35,7 +35,7 @@ const CommentsSearch = () => { ...@@ -35,7 +35,7 @@ const CommentsSearch = () => {
const pathname = usePathname(); const pathname = usePathname();
const router = useRouter(); const router = useRouter();
const { isCommentSearchDataLoading } = useCommentSearch(commentSearchProps); const { isCommentSearchDataFetching } = useCommentSearch(commentSearchProps);
const { handleCommentsSearch } = useHandleCommentsSearch(); const { handleCommentsSearch } = useHandleCommentsSearch();
const { operationsTypes } = useOperationsTypes(); const { operationsTypes } = useOperationsTypes();
...@@ -164,7 +164,7 @@ const CommentsSearch = () => { ...@@ -164,7 +164,7 @@ const CommentsSearch = () => {
disabled={!accountName || !permlink} disabled={!accountName || !permlink}
> >
Search Search
{isCommentSearchDataLoading && ( {isCommentSearchDataFetching && (
<Loader2 className="ml-2 animate-spin h-4 w-4 ..." /> <Loader2 className="ml-2 animate-spin h-4 w-4 ..." />
)} )}
</Button> </Button>
......
...@@ -8,7 +8,8 @@ const useCommentSearch = ( ...@@ -8,7 +8,8 @@ const useCommentSearch = (
) => { ) => {
const { const {
data: commentSearchData, data: commentSearchData,
isFetching: isCommentSearchDataLoading, isFetching: isCommentSearchDataFetching,
isLoading: isCommentSearchDataLoading,
isError: commentSearchDataError, isError: commentSearchDataError,
} = useQuery({ } = useQuery({
queryKey: ["commentSearch", commentSearchProps], queryKey: ["commentSearch", commentSearchProps],
...@@ -28,6 +29,7 @@ const useCommentSearch = ( ...@@ -28,6 +29,7 @@ const useCommentSearch = (
return { return {
commentSearchData, commentSearchData,
isCommentSearchDataLoading, isCommentSearchDataLoading,
isCommentSearchDataFetching,
commentSearchDataError, commentSearchDataError,
}; };
}; };
......
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