Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Remove unnecessary AccountFragment type casting #5537

Merged
merged 2 commits into from
Mar 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/web/src/components/Home/Sidebar/StaffPicks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import SingleAccountShimmer from "@components/Shared/Shimmer/SingleAccountShimme
import SingleAccount from "@components/Shared/SingleAccount";
import { CursorArrowRippleIcon as CursorArrowRippleIconOutline } from "@heroicons/react/24/outline";
import { HEY_API_URL } from "@hey/data/constants";
import { type AccountFragment, useStaffPicksQuery } from "@hey/indexer";
import { useStaffPicksQuery } from "@hey/indexer";
import type { StaffPick } from "@hey/types/hey";
import { Card, EmptyState, ErrorMessage, H5 } from "@hey/ui";
import { useQuery } from "@tanstack/react-query";
Expand Down Expand Up @@ -110,7 +110,7 @@ const StaffPicks: FC = () => {
!account.operations?.isFollowedByMe &&
currentAccount?.address !== account.address
)
.slice(0, 5) as AccountFragment[];
.slice(0, 5);

if (filteredAccounts.length === 0) {
return null;
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/components/Home/Sidebar/WhoToFollow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const WhoToFollow: FC = () => {
const recommendedAccounts = data?.mlAccountRecommendations.items.filter(
(account) =>
!account.operations?.isBlockedByMe && !account.operations?.isFollowedByMe
);
) as AccountFragment[];

if (recommendedAccounts?.length === 0) {
return null;
Expand Down Expand Up @@ -90,7 +90,7 @@ const WhoToFollow: FC = () => {
show={showMore}
title="Suggested for you"
>
<Suggested accounts={recommendedAccounts as AccountFragment[]} />
<Suggested accounts={recommendedAccounts} />
</Modal>
</>
);
Expand Down
7 changes: 3 additions & 4 deletions apps/web/src/components/Shared/Auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { HEY_APP } from "@hey/data/constants";
import { Errors } from "@hey/data/errors";
import { Events } from "@hey/data/events";
import {
type AccountFragment,
useAccountsAvailableQuery,
useAuthenticateMutation,
useChallengeMutation
Expand Down Expand Up @@ -106,9 +105,9 @@ const Login: FC<LoginProps> = ({ setHasAccounts }) => {
.map(({ account }) => account)
: allProfiles.map(({ account }) => account);

const accounts = (
lastLogin ? [lastLogin, ...remainingProfiles] : remainingProfiles
) as AccountFragment[];
const accounts = lastLogin
? [lastLogin, ...remainingProfiles]
: remainingProfiles;

return activeConnector?.id ? (
<div className="space-y-3">
Expand Down