Skip to content

Commit

Permalink
Remove unused queryClient and refetchUserData function in UserHome co…
Browse files Browse the repository at this point in the history
…mponent
  • Loading branch information
abhimanyurajeesh committed Jan 21, 2025
1 parent 9bc53a5 commit 3cfb5f0
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/components/Users/UserHome.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useQuery, useQueryClient } from "@tanstack/react-query";
import { useQuery } from "@tanstack/react-query";
import { Link } from "raviger";
import { useTranslation } from "react-i18next";

Expand Down Expand Up @@ -31,7 +31,6 @@ export default function UserHome(props: UserHomeProps) {
let { username } = props;
const { t } = useTranslation();
const authUser = useAuthUser();
const queryClient = useQueryClient();

if (!username) {
username = authUser.username;
Expand All @@ -46,12 +45,6 @@ export default function UserHome(props: UserHomeProps) {
enabled: Boolean(username),
});

const invalidateUserDetails = () => {
queryClient.invalidateQueries({
queryKey: ["getUserDetails", username],
});
};

if (isLoading || !userData) {
return <Loading />;
}
Expand Down Expand Up @@ -135,12 +128,7 @@ export default function UserHome(props: UserHomeProps) {
</div>
</div>
</div>
<SelectedTab
userData={userData}
username={username}
{...props}
refetchUserData={invalidateUserDetails}
/>
<SelectedTab userData={userData} username={username} {...props} />
</>
}
</Page>
Expand Down

0 comments on commit 3cfb5f0

Please sign in to comment.