From 82cd0d3a5be5517220521a0e2ccbe1e2648c67f3 Mon Sep 17 00:00:00 2001 From: shixuewen Date: Fri, 10 Nov 2023 16:27:41 +0800 Subject: [PATCH] fix: fix OwnedByAddress --- apps/u3/src/container/social/Social.tsx | 5 +++-- apps/u3/src/container/social/SocialLayout.tsx | 4 ++-- apps/u3/src/container/social/SocialLens.tsx | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/u3/src/container/social/Social.tsx b/apps/u3/src/container/social/Social.tsx index 2cbacd63..8b19b238 100644 --- a/apps/u3/src/container/social/Social.tsx +++ b/apps/u3/src/container/social/Social.tsx @@ -24,6 +24,7 @@ import { PostList, } from './CommonStyles'; import { useLensCtx } from '../../contexts/social/AppLensCtx'; +import { getOwnedByAddress } from '../../utils/social/lens/profile'; export default function SocialAll() { // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -31,8 +32,8 @@ export default function SocialAll() { const { isLogin } = useLogin(); const { sessionProfile: lensSessionProfile } = useLensCtx(); const fid = useFarcasterCurrFid(); - const { ownedBy: lensProfileOwnedByAddress, id: lensSessionProfileId } = - lensSessionProfile || {}; + const { id: lensSessionProfileId } = lensSessionProfile || {}; + const lensProfileOwnedByAddress = getOwnedByAddress(lensSessionProfile); const { socialPlatform, diff --git a/apps/u3/src/container/social/SocialLayout.tsx b/apps/u3/src/container/social/SocialLayout.tsx index 1be6a15f..1e577559 100644 --- a/apps/u3/src/container/social/SocialLayout.tsx +++ b/apps/u3/src/container/social/SocialLayout.tsx @@ -25,14 +25,14 @@ import SearchInput from '../../components/common/input/SearchInput'; import { useFarcasterCtx } from '../../contexts/social/FarcasterCtx'; import TrendChannel from '../../components/social/farcaster/TrendChannel'; import { useLensCtx } from '../../contexts/social/AppLensCtx'; +import { getOwnedByAddress } from '../../utils/social/lens/profile'; export default function SocialLayout() { const location = useLocation(); const { isConnected: isConnectedFarcaster } = useFarcasterCtx(); const { sessionProfile: lensSessionProfile } = useLensCtx(); const { loading: lensSessionLoading } = useSession(); - const { ownedBy: lensProfileOwnedBy } = lensSessionProfile || {}; - const { address: lensProfileOwnedByAddress } = lensProfileOwnedBy || {}; + const lensProfileOwnedByAddress = getOwnedByAddress(lensSessionProfile); const [postScroll, setPostScroll] = useState({ currentParent: '', diff --git a/apps/u3/src/container/social/SocialLens.tsx b/apps/u3/src/container/social/SocialLens.tsx index 2e8b6e02..39374004 100644 --- a/apps/u3/src/container/social/SocialLens.tsx +++ b/apps/u3/src/container/social/SocialLens.tsx @@ -22,6 +22,7 @@ import { PostList, } from './CommonStyles'; import { useLensCtx } from '../../contexts/social/AppLensCtx'; +import { getOwnedByAddress } from '../../utils/social/lens/profile'; export default function SocialFarcaster() { const [parentId] = useState('social-lens'); @@ -52,8 +53,8 @@ export default function SocialFarcaster() { const { feeds, firstLoading, pageInfo, moreLoading } = useListFeeds(parentId); const { sessionProfile } = useLensCtx(); - const { ownedBy: lensProfileOwnedByAddress, id: lensSessionProfileId } = - sessionProfile || {}; + const { id: lensSessionProfileId } = sessionProfile || {}; + const lensProfileOwnedByAddress = getOwnedByAddress(sessionProfile); const loadFirstFeeds = useCallback(async () => { setFirstLoadingDone(false);