From 27037b6a6fddcf97c6565e81be38792e48eec1b7 Mon Sep 17 00:00:00 2001 From: Julian Early Date: Wed, 3 Jul 2024 09:37:47 -0700 Subject: [PATCH] fix: switching between users spaces is more obvious now --- src/common/components/pages/SpacePage.tsx | 5 ++++- src/common/components/pages/UserDefinedSpace.tsx | 1 + src/fidgets/farcaster/Feed.tsx | 9 ++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/common/components/pages/SpacePage.tsx b/src/common/components/pages/SpacePage.tsx index bdd4ce98..6d4bbb03 100644 --- a/src/common/components/pages/SpacePage.tsx +++ b/src/common/components/pages/SpacePage.tsx @@ -10,6 +10,7 @@ type SpacePageArgs = { commitConfig?: () => Promise; resetConfig?: () => Promise; profile?: ReactNode; + loading?: boolean; }; export default function SpacePage({ @@ -18,6 +19,7 @@ export default function SpacePage({ commitConfig, resetConfig, profile, + loading, }: SpacePageArgs) { const [editMode, setEditMode] = useState(false); const [sidebarEditable, setSidebarEditable] = useState(false); @@ -44,7 +46,8 @@ export default function SpacePage({ {isUndefined(config) || isUndefined(saveConfig) || isUndefined(commitConfig) || - isUndefined(resetConfig) ? ( + isUndefined(resetConfig) || + loading ? ( ) : ( ); } diff --git a/src/fidgets/farcaster/Feed.tsx b/src/fidgets/farcaster/Feed.tsx index 93d34806..cb23f7e6 100644 --- a/src/fidgets/farcaster/Feed.tsx +++ b/src/fidgets/farcaster/Feed.tsx @@ -97,9 +97,8 @@ export const FEED_TYPES = [ { name: "Filter", value: FeedType.Filter }, ]; -const Feed: React.FC> = ({ - settings: { feedType, users, channel, filterType }, -}) => { +const Feed: React.FC> = ({ settings }) => { + const { feedType, users, channel, filterType } = settings; const { fid } = useFarcasterSigner("feed"); const { data, @@ -126,6 +125,10 @@ const Feed: React.FC> = ({ } }, [inView]); + useEffect(() => { + setShowCastThreadView(false); + }, [settings]); + const onSelectCast = (hash: string) => { setSelectedCastHash(hash); setShowCastThreadView(true);