From ac0bacbcc06994b9b9eb5cd3c4112e4c2accb234 Mon Sep 17 00:00:00 2001 From: diondiondion Date: Fri, 29 May 2026 15:07:00 +0200 Subject: [PATCH] [Glitch] Remove frontend check for collections feature flag Port 7fba458d9227bea224a6c779f895c4945005f074 to glitch-soc Signed-off-by: Claire --- .../components/empty_message.tsx | 78 +++++-------- .../features/account_featured/index.tsx | 106 ++++++++---------- .../collections/overview/created_by_you.tsx | 3 +- .../collections/overview/featuring_you.tsx | 3 +- .../glitch/features/collections/utils.ts | 5 - .../features/navigation_panel/index.tsx | 23 ++-- .../features/ui/components/block_modal.jsx | 11 +- .../flavours/glitch/features/ui/index.jsx | 11 +- .../flavours/glitch/utils/environment.ts | 2 +- 9 files changed, 98 insertions(+), 144 deletions(-) diff --git a/app/javascript/flavours/glitch/features/account_featured/components/empty_message.tsx b/app/javascript/flavours/glitch/features/account_featured/components/empty_message.tsx index 2b29bf4238..4eb367fb14 100644 --- a/app/javascript/flavours/glitch/features/account_featured/components/empty_message.tsx +++ b/app/javascript/flavours/glitch/features/account_featured/components/empty_message.tsx @@ -9,7 +9,6 @@ import { Button } from '@/flavours/glitch/components/button'; import { DisplayName } from '@/flavours/glitch/components/display_name'; import { EmptyState } from '@/flavours/glitch/components/empty_state'; import { LimitedAccountHint } from '@/flavours/glitch/components/limited_account_hint'; -import { areCollectionsEnabled } from '@/flavours/glitch/features/collections/utils'; import { useAccount } from '@/flavours/glitch/hooks/useAccount'; import { useCurrentAccountId } from '@/flavours/glitch/hooks/useAccountId'; import { useAppDispatch } from '@/flavours/glitch/store'; @@ -50,56 +49,39 @@ export const EmptyMessage: React.FC = ({ let title: React.ReactNode = null; let message: React.ReactNode = null; - const hasCollections = areCollectionsEnabled(); - if (me === accountId) { - if (hasCollections) { - // Return only here to insert the "Create a collection" button as the action for the empty state. - return ( - + } + message={ + + } + > + {!withoutAddCollectionButton && ( + - } - message={ - - } - > - {!withoutAddCollectionButton && ( - - - - )} - - - ); - } else { - title = ( - - ); - message = ( - - ); - } + + )} + + + ); } else if (suspended) { title = ( = ({ multiColumn, }) => { @@ -98,14 +95,11 @@ const AccountFeatured: React.FC<{ multiColumn: boolean }> = ({ ); const hasCollections = - collectionsEnabled && - collectionsLoadStatus === 'idle' && - listedCollections.length > 0; + collectionsLoadStatus === 'idle' && listedCollections.length > 0; const hasFeaturedAccounts = !featuredAccountIds.isEmpty(); - const isLoading = - !accountId || (collectionsEnabled && collectionsLoadStatus !== 'idle'); + const isLoading = !accountId || collectionsLoadStatus !== 'idle'; if (accountId === null) { return ; @@ -165,57 +159,53 @@ const AccountFeatured: React.FC<{ multiColumn: boolean }> = ({ )} - {collectionsEnabled && ( - <> - -

- -

- {accountId === me && ( - - - - )} -
- {hasCollections ? ( - - - ), - subtitle: ( - - ), - }} - renderListItem={renderListItem} - /> - - ) : ( -