Profile Gifts: Fix flick (#5674)

This commit is contained in:
Alexander Zinchuk 2025-03-01 17:59:41 +01:00
parent 6f74540e98
commit 015a6472a1
2 changed files with 7 additions and 12 deletions

View File

@ -52,7 +52,6 @@
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
padding-top: 5rem; padding-top: 5rem;
height: 100%;
.description { .description {
color: var(--color-text-secondary); color: var(--color-text-secondary);

View File

@ -49,7 +49,6 @@ import {
selectChatMessages, selectChatMessages,
selectCurrentSharedMediaSearch, selectCurrentSharedMediaSearch,
selectIsCurrentUserPremium, selectIsCurrentUserPremium,
selectIsGiftProfileFilterDefault,
selectIsRightColumnShown, selectIsRightColumnShown,
selectPeerStories, selectPeerStories,
selectSimilarBotsIds, selectSimilarBotsIds,
@ -160,7 +159,6 @@ type StateProps = {
isSavedDialog?: boolean; isSavedDialog?: boolean;
forceScrollProfileTab?: boolean; forceScrollProfileTab?: boolean;
isSynced?: boolean; isSynced?: boolean;
isNotDefaultGiftFilter?: boolean;
}; };
type TabProps = { type TabProps = {
@ -226,7 +224,6 @@ const Profile: FC<OwnProps & StateProps> = ({
forceScrollProfileTab, forceScrollProfileTab,
isSynced, isSynced,
onProfileStateChange, onProfileStateChange,
isNotDefaultGiftFilter,
}) => { }) => {
const { const {
setSharedMediaSearchType, setSharedMediaSearchType,
@ -579,12 +576,14 @@ const Profile: FC<OwnProps & StateProps> = ({
); );
} }
if (viewportIds && !viewportIds?.length) { const isViewportIdsEmpty = viewportIds && !viewportIds?.length;
let text: string;
if (resultType === 'gifts' && isNotDefaultGiftFilter) { if (isViewportIdsEmpty && resultType === 'gifts') {
return renderNothingFoundGiftsWithFilter(); return renderNothingFoundGiftsWithFilter();
} }
if (isViewportIdsEmpty) {
let text: string;
switch (resultType) { switch (resultType) {
case 'members': case 'members':
@ -977,8 +976,6 @@ export default memo(withGlobal<OwnProps>(
const peerGifts = selectTabState(global).savedGifts.giftsByPeerId[chatId]; const peerGifts = selectTabState(global).savedGifts.giftsByPeerId[chatId];
const giftsTransitionKey = selectTabState(global).savedGifts.transitionKey || 0; const giftsTransitionKey = selectTabState(global).savedGifts.transitionKey || 0;
const isNotDefaultGiftFilter = !selectIsGiftProfileFilterDefault(global);
return { return {
theme: selectTheme(global), theme: selectTheme(global),
isChannel, isChannel,
@ -1018,7 +1015,6 @@ export default memo(withGlobal<OwnProps>(
isTopicInfo, isTopicInfo,
isSavedDialog, isSavedDialog,
isSynced: global.isSynced, isSynced: global.isSynced,
isNotDefaultGiftFilter,
limitSimilarPeers: selectPremiumLimit(global, 'recommendedChannels'), limitSimilarPeers: selectPremiumLimit(global, 'recommendedChannels'),
...(hasMembersTab && members && { members, adminMembersById }), ...(hasMembersTab && members && { members, adminMembersById }),
...(hasCommonChatsTab && user && { commonChatIds: commonChats?.ids }), ...(hasCommonChatsTab && user && { commonChatIds: commonChats?.ids }),