diff --git a/src/api/gramjs/apiBuilders/symbols.ts b/src/api/gramjs/apiBuilders/symbols.ts index 01893eb4e..c50ff4535 100644 --- a/src/api/gramjs/apiBuilders/symbols.ts +++ b/src/api/gramjs/apiBuilders/symbols.ts @@ -116,7 +116,7 @@ export function buildStickerSet(set: GramJs.StickerSet): ApiStickerSet { } = set; return { - archived, + isArchived: archived, isLottie: animated, isVideos: videos, isEmoji: emojis, diff --git a/src/api/types/messages.ts b/src/api/types/messages.ts index f8f000d70..2f833e301 100644 --- a/src/api/types/messages.ts +++ b/src/api/types/messages.ts @@ -47,7 +47,7 @@ export interface ApiSticker { } export interface ApiStickerSet { - archived?: true; + isArchived?: true; isLottie?: true; isVideos?: true; isEmoji?: true; diff --git a/src/components/common/StickerSetModal.tsx b/src/components/common/StickerSetModal.tsx index c785ff78f..ba18ec570 100644 --- a/src/components/common/StickerSetModal.tsx +++ b/src/components/common/StickerSetModal.tsx @@ -79,7 +79,7 @@ const StickerSetModal: FC = ({ const prevStickerSet = usePrevious(stickerSet); const renderingStickerSet = stickerSet || prevStickerSet; - const isAdded = renderingStickerSet?.installedDate; + const isAdded = !renderingStickerSet?.isArchived && renderingStickerSet?.installedDate; const isEmoji = renderingStickerSet?.isEmoji; const isButtonLocked = !isAdded && isSetPremium && !isCurrentUserPremium; diff --git a/src/components/common/TopicDefaultIcon.module.scss b/src/components/common/TopicDefaultIcon.module.scss index 9893851c1..2495c1132 100644 --- a/src/components/common/TopicDefaultIcon.module.scss +++ b/src/components/common/TopicDefaultIcon.module.scss @@ -2,6 +2,7 @@ display: inline-flex; align-items: center; justify-content: center; + vertical-align: middle; position: relative; width: 1.25rem; @@ -20,8 +21,10 @@ color: #ffffff; font-weight: 500; font-size: 0.75em; - position: relative; - bottom: 0.0625rem; + line-height: 1; + position: absolute; + top: 50%; + transform: translateY(-50%); :global(.emoji) { width: 1em; diff --git a/src/components/middle/composer/CustomEmojiPicker.tsx b/src/components/middle/composer/CustomEmojiPicker.tsx index cc3fe75a7..f530826a1 100644 --- a/src/components/middle/composer/CustomEmojiPicker.tsx +++ b/src/components/middle/composer/CustomEmojiPicker.tsx @@ -20,7 +20,7 @@ import { MEMO_EMPTY_ARRAY } from '../../../util/memo'; import fastSmoothScroll from '../../../util/fastSmoothScroll'; import buildClassName from '../../../util/buildClassName'; import fastSmoothScrollHorizontal from '../../../util/fastSmoothScrollHorizontal'; -import { pickTruthy } from '../../../util/iteratees'; +import { pickTruthy, unique } from '../../../util/iteratees'; import { selectIsAlwaysHighPriorityEmoji, selectIsChatWithSelf, @@ -147,15 +147,13 @@ const CustomEmojiPicker: FC = ({ }); } - const existingAddedSetIds = Object.values(pickTruthy(stickerSetsById, addedCustomEmojiIds)); + const setIdsToDisplay = unique(addedCustomEmojiIds.concat(featuredCustomEmojiIds || [])); - const filteredFeaturedIds = featuredCustomEmojiIds?.filter((id) => !addedCustomEmojiIds.includes(id)) || []; - const featuredSetIds = Object.values(pickTruthy(stickerSetsById, filteredFeaturedIds)); + const setsToDisplay = Object.values(pickTruthy(stickerSetsById, setIdsToDisplay)); return [ ...defaultSets, - ...existingAddedSetIds, - ...featuredSetIds, + ...setsToDisplay, ]; }, [ addedCustomEmojiIds, defaultTopicIconsId, featuredCustomEmojiIds, lang, recentCustomEmoji, stickerSetsById, diff --git a/src/components/middle/composer/StickerSet.tsx b/src/components/middle/composer/StickerSet.tsx index 84049e680..d9de73040 100644 --- a/src/components/middle/composer/StickerSet.tsx +++ b/src/components/middle/composer/StickerSet.tsx @@ -164,7 +164,8 @@ const StickerSet: FC = ({ const isLocked = !isSavedMessages && !isRecent && isEmoji && !isCurrentUserPremium && stickerSet.stickers?.some(({ isFree }) => !isFree); - const canCut = !stickerSet.installedDate && stickerSet.id !== RECENT_SYMBOL_SET_ID; + const isInstalled = stickerSet.installedDate && !stickerSet.isArchived; + const canCut = !isInstalled && stickerSet.id !== RECENT_SYMBOL_SET_ID; const [isCut, , expand] = useFlag(canCut); const itemsBeforeCutout = itemsPerRow * 3 - 1; const totalItemsCount = withDefaultTopicIcon ? stickerSet.count + 1 : stickerSet.count; @@ -196,7 +197,7 @@ const StickerSet: FC = ({ {isRecent && ( )} - {!isRecent && isEmoji && !stickerSet.installedDate && ( + {!isRecent && isEmoji && !isInstalled && (