diff --git a/apps/web/src/components/Account/AccountFeed.tsx b/apps/web/src/components/Account/AccountFeed.tsx index 6ee2bc530e0b..2d916de602bb 100644 --- a/apps/web/src/components/Account/AccountFeed.tsx +++ b/apps/web/src/components/Account/AccountFeed.tsx @@ -17,7 +17,7 @@ import { Virtuoso } from "react-virtuoso"; import { useImpressionsStore } from "src/store/non-persisted/useImpressionsStore"; import { useProfileFeedStore } from "src/store/non-persisted/useProfileFeedStore"; import { useTipsStore } from "src/store/non-persisted/useTipsStore"; -import { useProfileStore } from "src/store/persisted/useProfileStore"; +import { useAccountStore } from "src/store/persisted/useAccountStore"; import { useTransactionStore } from "src/store/persisted/useTransactionStore"; let virtuosoState: any = { ranges: [], screenTop: 0 }; @@ -39,7 +39,7 @@ const AccountFeed: FC = ({ profileId, type }) => { - const { currentProfile } = useProfileStore(); + const { currentAccount } = useAccountStore(); const { mediaFeedFilters } = useProfileFeedStore(); const { fetchAndStoreViews } = useImpressionsStore(); const { fetchAndStoreTips } = useTipsStore(); @@ -113,7 +113,7 @@ const AccountFeed: FC = ({ const hasMore = pageInfo?.next; useEffect(() => { - if (indexedPostHash && currentProfile?.id === profileId) { + if (indexedPostHash && currentAccount?.id === profileId) { refetch(); } }, [indexedPostHash]); diff --git a/apps/web/src/components/Account/Details.tsx b/apps/web/src/components/Account/Details.tsx index a5be83e7826d..5bb1e01a0c20 100644 --- a/apps/web/src/components/Account/Details.tsx +++ b/apps/web/src/components/Account/Details.tsx @@ -30,7 +30,7 @@ import Link from "next/link"; import { useRouter } from "next/router"; import type { FC, ReactNode } from "react"; import { useState } from "react"; -import { useProfileStore } from "src/store/persisted/useProfileStore"; +import { useAccountStore } from "src/store/persisted/useAccountStore"; import urlcat from "urlcat"; import AccountStatus from "./AccountStatus"; import Badges from "./Badges"; @@ -61,7 +61,7 @@ interface DetailsProps { const Details: FC = ({ isSuspended = false, profile }) => { const { push } = useRouter(); - const { currentProfile } = useProfileStore(); + const { currentAccount } = useAccountStore(); const [expandedImage, setExpandedImage] = useState(null); const [showPersonalizeModal, setShowPersonalizeModal] = useState(false); const isStaff = useFlag(FeatureFlag.Staff); @@ -120,7 +120,7 @@ const Details: FC = ({ isSuspended = false, profile }) => {
- {currentProfile?.id === profile.id ? ( + {currentAccount?.id === profile.id ? ( <>
- {currentProfile?.id !== profile.id ? ( + {currentAccount?.id !== profile.id ? ( = ({ profile }) => { - const { currentProfile } = useProfileStore(); + const { currentAccount } = useAccountStore(); const [showCreateModal, setShowCreateModal] = useState(false); const [deleting, setDeleting] = useState(false); const [deletingList, setDeletingList] = useState(null); @@ -67,7 +67,7 @@ const Lists: FC = ({ profile }) => { ); queryClient.setQueryData( - [GET_LISTS_QUERY_KEY, currentProfile?.id], + [GET_LISTS_QUERY_KEY, currentAccount?.id], (oldData) => oldData?.filter((list) => list.id !== id) ); toast.success("List deleted"); @@ -90,7 +90,7 @@ const Lists: FC = ({ profile }) => { ); queryClient.setQueryData( - [GET_LISTS_QUERY_KEY, currentProfile?.id], + [GET_LISTS_QUERY_KEY, currentAccount?.id], (oldData) => oldData?.map((list) => list.id === id ? { ...list, pinned: !pinned } : list @@ -109,7 +109,7 @@ const Lists: FC = ({ profile }) => {
{getAccount(profile).slugWithPrefix}'s Lists
- {profile.id === currentProfile?.id && ( + {profile.id === currentAccount?.id && ( @@ -126,7 +126,7 @@ const Lists: FC = ({ profile }) => { {data?.map((list) => (
- {profile.id === currentProfile?.id && ( + {profile.id === currentAccount?.id && (
= ({ profile }) => { - const { currentProfile } = useProfileStore(); + const { currentAccount } = useAccountStore(); return ( @@ -40,7 +40,7 @@ const AccountMenu: FC = ({ profile }) => { - {currentProfile && currentProfile?.id !== profile.id ? ( + {currentAccount && currentAccount?.id !== profile.id ? ( <> diff --git a/apps/web/src/components/Account/MutualFollowersOverview.tsx b/apps/web/src/components/Account/MutualFollowersOverview.tsx index 821ed15f4079..9fcf9b4bd65e 100644 --- a/apps/web/src/components/Account/MutualFollowersOverview.tsx +++ b/apps/web/src/components/Account/MutualFollowersOverview.tsx @@ -8,7 +8,7 @@ import { LimitType, useMutualFollowersQuery } from "@hey/lens"; import { Modal, StackedAvatars } from "@hey/ui"; import cn from "@hey/ui/cn"; import { type FC, type ReactNode, useState } from "react"; -import { useProfileStore } from "src/store/persisted/useProfileStore"; +import { useAccountStore } from "src/store/persisted/useAccountStore"; interface MutualFollowersOverviewProps { handle: string; @@ -21,16 +21,16 @@ const MutualFollowersOverview: FC = ({ profileId, viaPopover = false }) => { - const { currentProfile } = useProfileStore(); + const { currentAccount } = useAccountStore(); const [showMutualFollowersModal, setShowMutualFollowersModal] = useState(false); const { data, error, loading } = useMutualFollowersQuery({ - skip: !profileId || !currentProfile?.id, + skip: !profileId || !currentAccount?.id, variables: { request: { limit: LimitType.Ten, - observer: currentProfile?.id, + observer: currentAccount?.id, viewing: profileId } } diff --git a/apps/web/src/components/Account/index.tsx b/apps/web/src/components/Account/index.tsx index d49d3235a582..a392c5242c92 100644 --- a/apps/web/src/components/Account/index.tsx +++ b/apps/web/src/components/Account/index.tsx @@ -25,7 +25,7 @@ import { useRouter } from "next/router"; import { useEffect } from "react"; import Custom404 from "src/pages/404"; import Custom500 from "src/pages/500"; -import { useProfileStore } from "src/store/persisted/useProfileStore"; +import { useAccountStore } from "src/store/persisted/useAccountStore"; import AccountFeed from "./AccountFeed"; import Details from "./Details"; import FeedType from "./FeedType"; @@ -39,7 +39,7 @@ const ViewProfile: NextPage = () => { pathname, query: { handle, id, source, type } } = useRouter(); - const { currentProfile } = useProfileStore(); + const { currentAccount } = useAccountStore(); const isStaff = useFlag(FeatureFlag.Staff); useEffect(() => { @@ -142,7 +142,7 @@ const ViewProfile: NextPage = () => { ) : ( <> - {currentProfile?.id === profile?.id && + {currentAccount?.id === profile?.id && feedType !== AccountFeedType.Lists ? ( ) : null} diff --git a/apps/web/src/components/Analytics/index.tsx b/apps/web/src/components/Analytics/index.tsx index c84e2839aee9..e69f289e7f87 100644 --- a/apps/web/src/components/Analytics/index.tsx +++ b/apps/web/src/components/Analytics/index.tsx @@ -8,7 +8,7 @@ import { GridItemTwelve, GridLayout } from "@hey/ui"; import type { NextPage } from "next"; import { useRouter } from "next/router"; import { useEffect } from "react"; -import { useProfileStore } from "src/store/persisted/useProfileStore"; +import { useAccountStore } from "src/store/persisted/useAccountStore"; import AnalyticsType from "./AnalyticsType"; import Impressions from "./Impressions"; import Overview from "./Overview"; @@ -17,7 +17,7 @@ const Analytics: NextPage = () => { const { query: { type } } = useRouter(); - const { currentProfile } = useProfileStore(); + const { currentAccount } = useAccountStore(); useEffect(() => { Leafwatch.track(PAGEVIEW, { page: "analytics" }); @@ -34,7 +34,7 @@ const Analytics: NextPage = () => { : AnalyticsTabType.Overview : AnalyticsTabType.Overview; - if (!currentProfile) { + if (!currentAccount) { return ; } diff --git a/apps/web/src/components/Bookmarks/index.tsx b/apps/web/src/components/Bookmarks/index.tsx index 00cd78d27696..48352c0ead4c 100644 --- a/apps/web/src/components/Bookmarks/index.tsx +++ b/apps/web/src/components/Bookmarks/index.tsx @@ -10,18 +10,18 @@ import type { PublicationMetadataMainFocusType } from "@hey/lens"; import { GridItemEight, GridItemFour, GridLayout } from "@hey/ui"; import type { NextPage } from "next"; import { useEffect, useState } from "react"; -import { useProfileStore } from "src/store/persisted/useProfileStore"; +import { useAccountStore } from "src/store/persisted/useAccountStore"; import BookmarksFeed from "./BookmarksFeed"; const Bookmarks: NextPage = () => { - const { currentProfile } = useProfileStore(); + const { currentAccount } = useAccountStore(); const [focus, setFocus] = useState(); useEffect(() => { Leafwatch.track(PAGEVIEW, { page: "bookmarks" }); }, []); - if (!currentProfile) { + if (!currentAccount) { return ; } diff --git a/apps/web/src/components/Club/Members.tsx b/apps/web/src/components/Club/Members.tsx index 5bf54e252157..2b151c6215b7 100644 --- a/apps/web/src/components/Club/Members.tsx +++ b/apps/web/src/components/Club/Members.tsx @@ -11,7 +11,7 @@ import axios from "axios"; import Link from "next/link"; import type { FC } from "react"; import { Virtuoso } from "react-virtuoso"; -import { useProfileStore } from "src/store/persisted/useProfileStore"; +import { useAccountStore } from "src/store/persisted/useAccountStore"; const GET_CLUB_MEMBERS_QUERY_KEY = "getClubMembers"; @@ -21,7 +21,7 @@ interface MembersProps { } const Members: FC = ({ clubId, handle }) => { - const { currentProfile } = useProfileStore(); + const { currentAccount } = useAccountStore(); const getClubMembers = async (): Promise<{ items: ClubProfile[]; @@ -113,8 +113,8 @@ const Members: FC = ({ clubId, handle }) => { itemContent={(_, member) => (
{ pathname, query: { handle } } = useRouter(); - const { currentProfile } = useProfileStore(); + const { currentAccount } = useAccountStore(); const showMembers = pathname === "/c/[handle]/members"; @@ -46,7 +46,7 @@ const ViewClub: NextPage = () => { queryFn: () => getClub({ club_handle: handle as string, - profile_id: currentProfile?.id + profile_id: currentAccount?.id }), queryKey: [GET_CLUB_QUERY_KEY, handle] }); @@ -79,7 +79,7 @@ const ViewClub: NextPage = () => { ) : ( <> - {currentProfile && club.isMember && ( + {currentAccount && club.isMember && ( = ({ children }) => { const { reload } = useRouter(); const { resolvedTheme } = useTheme(); const { theme } = useProfileThemeStore(); - const { currentProfile, setCurrentProfile, setFallbackToCuratedFeed } = - useProfileStore(); + const { currentAccount, setCurrentAccount, setFallbackToCuratedFeed } = + useAccountStore(); const { resetPreferences } = usePreferencesStore(); const { resetStatus } = useProfileStatus(); const { setLensHubOnchainSigNonce } = useNonceStore(); @@ -55,7 +55,7 @@ const Layout: FC = ({ children }) => { const { loading } = useCurrentProfileQuery({ onCompleted: ({ profile, userSigNonces }) => { - setCurrentProfile(profile as Profile); + setCurrentAccount(profile as Profile); setLensHubOnchainSigNonce(userSigNonces.lensHubOnchainSigNonce); // If the profile has no following, we should fallback to the curated feed @@ -80,7 +80,7 @@ const Layout: FC = ({ children }) => { validateAuthentication(); }, []); - const profileLoading = !currentProfile && loading; + const profileLoading = !currentAccount && loading; if (profileLoading || !isMounted) { return ; diff --git a/apps/web/src/components/Composer/Actions/CollectSettings/AmountConfig.tsx b/apps/web/src/components/Composer/Actions/CollectSettings/AmountConfig.tsx index ce6b9e664fcd..0036f309bcc8 100644 --- a/apps/web/src/components/Composer/Actions/CollectSettings/AmountConfig.tsx +++ b/apps/web/src/components/Composer/Actions/CollectSettings/AmountConfig.tsx @@ -6,15 +6,15 @@ import type { CollectModuleType } from "@hey/types/hey"; import { Input, Select } from "@hey/ui"; import type { FC } from "react"; import { useCollectModuleStore } from "src/store/non-persisted/post/useCollectModuleStore"; +import { useAccountStore } from "src/store/persisted/useAccountStore"; import { useAllowedTokensStore } from "src/store/persisted/useAllowedTokensStore"; -import { useProfileStore } from "src/store/persisted/useProfileStore"; interface AmountConfigProps { setCollectType: (data: CollectModuleType) => void; } const AmountConfig: FC = ({ setCollectType }) => { - const { currentProfile } = useProfileStore(); + const { currentAccount } = useAccountStore(); const { collectModule } = useCollectModuleStore((state) => state); const { allowedTokens } = useAllowedTokensStore(); @@ -34,7 +34,7 @@ const AmountConfig: FC = ({ setCollectType }) => { : { currency: DEFAULT_COLLECT_TOKEN, value: "1" }, recipients: enabled ? [] - : [{ recipient: currentProfile?.ownedBy.address, split: 100 }], + : [{ recipient: currentAccount?.ownedBy.address, split: 100 }], type: enabled ? CollectOpenActionModuleType.SimpleCollectOpenActionModule : CollectOpenActionModuleType.MultirecipientFeeCollectOpenActionModule diff --git a/apps/web/src/components/Composer/Actions/CollectSettings/SplitConfig.tsx b/apps/web/src/components/Composer/Actions/CollectSettings/SplitConfig.tsx index e034d13a317b..43c3a040a5dc 100644 --- a/apps/web/src/components/Composer/Actions/CollectSettings/SplitConfig.tsx +++ b/apps/web/src/components/Composer/Actions/CollectSettings/SplitConfig.tsx @@ -13,7 +13,7 @@ import { Button, H6, Input } from "@hey/ui"; import type { FC } from "react"; import { useState } from "react"; import { useCollectModuleStore } from "src/store/non-persisted/post/useCollectModuleStore"; -import { useProfileStore } from "src/store/persisted/useProfileStore"; +import { useAccountStore } from "src/store/persisted/useAccountStore"; import { isAddress } from "viem"; interface SplitConfigProps { @@ -25,10 +25,10 @@ const SplitConfig: FC = ({ isRecipientsDuplicated, setCollectType }) => { - const { currentProfile } = useProfileStore(); + const { currentAccount } = useAccountStore(); const { collectModule } = useCollectModuleStore((state) => state); - const currentAddress = currentProfile?.ownedBy.address || ""; + const currentAddress = currentAccount?.ownedBy.address || ""; const recipients = collectModule.recipients || []; const [isToggleOn, setIsToggleOn] = useState( recipients.length > 1 || diff --git a/apps/web/src/components/Composer/Editor/Editor.tsx b/apps/web/src/components/Composer/Editor/Editor.tsx index 0ad410ba94e3..6348516be406 100644 --- a/apps/web/src/components/Composer/Editor/Editor.tsx +++ b/apps/web/src/components/Composer/Editor/Editor.tsx @@ -12,14 +12,14 @@ import useContentChange from "src/hooks/prosekit/useContentChange"; import useFocus from "src/hooks/prosekit/useFocus"; import { usePaste } from "src/hooks/prosekit/usePaste"; import { usePostStore } from "src/store/non-persisted/post/usePostStore"; -import { useProfileStore } from "src/store/persisted/useProfileStore"; +import { useAccountStore } from "src/store/persisted/useAccountStore"; import { useEditorHandle } from "./EditorHandle"; // Lazy load EditorMenus to reduce bundle size const EditorMenus = dynamic(() => import("./EditorMenus"), { ssr: false }); const Editor: FC = () => { - const { currentProfile } = useProfileStore(); + const { currentAccount } = useAccountStore(); const { postContent } = usePostStore(); const defaultMarkdownRef = useRef(postContent); @@ -42,9 +42,9 @@ const Editor: FC = () => {
{currentProfile?.id}
diff --git a/apps/web/src/components/Composer/NewPost.tsx b/apps/web/src/components/Composer/NewPost.tsx index 88d14c45b629..3a4dd1f6f7a5 100644 --- a/apps/web/src/components/Composer/NewPost.tsx +++ b/apps/web/src/components/Composer/NewPost.tsx @@ -5,7 +5,7 @@ import { useRouter } from "next/router"; import type { FC } from "react"; import { useEffect, useState } from "react"; import { usePostStore } from "src/store/non-persisted/post/usePostStore"; -import { useProfileStore } from "src/store/persisted/useProfileStore"; +import { useAccountStore } from "src/store/persisted/useAccountStore"; import NewPublication from "./NewPublication"; interface NewPostProps { @@ -14,7 +14,7 @@ interface NewPostProps { const NewPost: FC = ({ tags }) => { const { isReady, query } = useRouter(); - const { currentProfile } = useProfileStore(); + const { currentAccount } = useAccountStore(); const { setPostContent, setTags } = usePostStore(); const [showComposer, setShowComposer] = useState(false); @@ -57,13 +57,13 @@ const NewPost: FC = ({ tags }) => { >
{currentProfile?.id} { - currentTarget.src = getLennyURL(currentProfile?.id); + currentTarget.src = getLennyURL(currentAccount?.id); }} - src={getAvatar(currentProfile)} + src={getAvatar(currentAccount)} width={44} /> What's new?! diff --git a/apps/web/src/components/Composer/NewPublication.tsx b/apps/web/src/components/Composer/NewPublication.tsx index 0d2bec16a08a..388e7fd2271a 100644 --- a/apps/web/src/components/Composer/NewPublication.tsx +++ b/apps/web/src/components/Composer/NewPublication.tsx @@ -54,7 +54,7 @@ import { useGlobalModalStateStore } from "src/store/non-persisted/useGlobalModal import { useNonceStore } from "src/store/non-persisted/useNonceStore"; import { useProfileStatus } from "src/store/non-persisted/useProfileStatus"; import { useReferenceModuleStore } from "src/store/non-persisted/useReferenceModuleStore"; -import { useProfileStore } from "src/store/persisted/useProfileStore"; +import { useAccountStore } from "src/store/persisted/useAccountStore"; import LivestreamEditor from "./Actions/LivestreamSettings/LivestreamEditor"; import PollEditor from "./Actions/PollSettings/PollEditor"; import { Editor, useEditorContext, withEditorContext } from "./Editor"; @@ -95,7 +95,7 @@ interface NewPublicationProps { } const NewPublication: FC = ({ className, post }) => { - const { currentProfile } = useProfileStore(); + const { currentAccount } = useAccountStore(); const { isSuspended } = useProfileStatus(); // Global modal store @@ -151,7 +151,7 @@ const NewPublication: FC = ({ className, post }) => { const createPoll = useCreatePoll(); const getMetadata = usePostMetadata(); - const { canUseLensManager } = checkDispatcherPermissions(currentProfile); + const { canUseLensManager } = checkDispatcherPermissions(currentAccount); const isComment = Boolean(post); const isQuote = Boolean(quotedPost); @@ -283,7 +283,7 @@ const NewPublication: FC = ({ className, post }) => { }; const handleCreatePost = async () => { - if (!currentProfile) { + if (!currentAccount) { return toast.error(Errors.SignWallet); } @@ -323,7 +323,7 @@ const NewPublication: FC = ({ className, post }) => { postContent.length > 0 ? postContent : undefined; const title = hasAudio ? audioPost.title - : `${getTitlePrefix()} by ${getAccount(currentProfile).slugWithPrefix}`; + : `${getTitlePrefix()} by ${getAccount(currentAccount).slugWithPrefix}`; const hasAttributes = Boolean(pollId); const baseMetadata = { @@ -345,7 +345,7 @@ const NewPublication: FC = ({ className, post }) => { marketplace: { animation_url: getAnimationUrl(), description: processedPostContent, - external_url: `https://hey.xyz${getAccount(currentProfile).link}`, + external_url: `https://hey.xyz${getAccount(currentAccount).link}`, name: title } }; diff --git a/apps/web/src/components/Explore/index.tsx b/apps/web/src/components/Explore/index.tsx index 2dd057d23f00..94815b25cce7 100644 --- a/apps/web/src/components/Explore/index.tsx +++ b/apps/web/src/components/Explore/index.tsx @@ -13,13 +13,13 @@ import cn from "@hey/ui/cn"; import type { NextPage } from "next"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; -import { useProfileStore } from "src/store/persisted/useProfileStore"; +import { useAccountStore } from "src/store/persisted/useAccountStore"; import ExploreFeed from "./ExploreFeed"; import ImageFeed from "./ImageFeed"; const Explore: NextPage = () => { const router = useRouter(); - const { currentProfile } = useProfileStore(); + const { currentAccount } = useAccountStore(); const [focus, setFocus] = useState(); useEffect(() => { @@ -86,7 +86,7 @@ const Explore: NextPage = () => { {/* */} - {currentProfile ? : null} + {currentAccount ? : null}