mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Attempted to fix change color in preview while reset unique status.
This commit is contained in:
@@ -2214,15 +2214,15 @@ void EditPeerProfileColorSection(
|
||||
|
||||
const auto setIndex = [=](uint8 index) {
|
||||
state->index = index;
|
||||
if (index != kUnsetColorIndex) {
|
||||
resetUnique();
|
||||
}
|
||||
preview->setColorProfileIndex(index == kUnsetColorIndex
|
||||
? std::nullopt
|
||||
: std::make_optional(index));
|
||||
preview->setPatternEmojiId(index == kUnsetColorIndex
|
||||
? std::nullopt
|
||||
: std::make_optional(state->patternEmojiId.current()));
|
||||
if (index != kUnsetColorIndex) {
|
||||
resetUnique();
|
||||
}
|
||||
};
|
||||
setIndex(peer->colorProfileIndex().value_or(kUnsetColorIndex));
|
||||
|
||||
|
||||
@@ -1250,7 +1250,7 @@ void TopBar::setPatternEmojiId(std::optional<DocumentId> patternEmojiId) {
|
||||
|
||||
void TopBar::setLocalEmojiStatusId(EmojiStatusId emojiStatusId) {
|
||||
_localCollectible = emojiStatusId.collectible;
|
||||
if (emojiStatusId) {
|
||||
if (!emojiStatusId.collectible) {
|
||||
_badgeContent = Badge::Content{ BadgeType::Premium, emojiStatusId };
|
||||
} else {
|
||||
_badgeContent = BadgeContentForPeer(_peer);
|
||||
@@ -1271,6 +1271,8 @@ auto TopBar::effectiveCollectible() const
|
||||
-> std::shared_ptr<Data::EmojiStatusCollectible> {
|
||||
return _localCollectible
|
||||
? _localCollectible
|
||||
: _localColorProfileIndex
|
||||
? nullptr
|
||||
: _peer->emojiStatusId().collectible;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user