From 015a6472a1f62cc57ffeda728ec17ff67d14f15b Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Sat, 1 Mar 2025 17:59:41 +0100 Subject: [PATCH] Profile Gifts: Fix flick (#5674) --- src/components/right/Profile.scss | 1 - src/components/right/Profile.tsx | 18 +++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/components/right/Profile.scss b/src/components/right/Profile.scss index 182db03b4..b91328a64 100644 --- a/src/components/right/Profile.scss +++ b/src/components/right/Profile.scss @@ -52,7 +52,6 @@ justify-content: center; flex-direction: column; padding-top: 5rem; - height: 100%; .description { color: var(--color-text-secondary); diff --git a/src/components/right/Profile.tsx b/src/components/right/Profile.tsx index e7a82197f..444d59a66 100644 --- a/src/components/right/Profile.tsx +++ b/src/components/right/Profile.tsx @@ -49,7 +49,6 @@ import { selectChatMessages, selectCurrentSharedMediaSearch, selectIsCurrentUserPremium, - selectIsGiftProfileFilterDefault, selectIsRightColumnShown, selectPeerStories, selectSimilarBotsIds, @@ -160,7 +159,6 @@ type StateProps = { isSavedDialog?: boolean; forceScrollProfileTab?: boolean; isSynced?: boolean; - isNotDefaultGiftFilter?: boolean; }; type TabProps = { @@ -226,7 +224,6 @@ const Profile: FC = ({ forceScrollProfileTab, isSynced, onProfileStateChange, - isNotDefaultGiftFilter, }) => { const { setSharedMediaSearchType, @@ -579,12 +576,14 @@ const Profile: FC = ({ ); } - if (viewportIds && !viewportIds?.length) { - let text: string; + const isViewportIdsEmpty = viewportIds && !viewportIds?.length; - if (resultType === 'gifts' && isNotDefaultGiftFilter) { - return renderNothingFoundGiftsWithFilter(); - } + if (isViewportIdsEmpty && resultType === 'gifts') { + return renderNothingFoundGiftsWithFilter(); + } + + if (isViewportIdsEmpty) { + let text: string; switch (resultType) { case 'members': @@ -977,8 +976,6 @@ export default memo(withGlobal( const peerGifts = selectTabState(global).savedGifts.giftsByPeerId[chatId]; const giftsTransitionKey = selectTabState(global).savedGifts.transitionKey || 0; - const isNotDefaultGiftFilter = !selectIsGiftProfileFilterDefault(global); - return { theme: selectTheme(global), isChannel, @@ -1018,7 +1015,6 @@ export default memo(withGlobal( isTopicInfo, isSavedDialog, isSynced: global.isSynced, - isNotDefaultGiftFilter, limitSimilarPeers: selectPremiumLimit(global, 'recommendedChannels'), ...(hasMembersTab && members && { members, adminMembersById }), ...(hasCommonChatsTab && user && { commonChatIds: commonChats?.ids }),