mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-28 21:18:46 +00:00
Fix gifts display when can't manage.
This commit is contained in:
parent
22515c8c29
commit
2b16b0fc7c
@ -858,7 +858,9 @@ void InnerWidget::refreshAbout() {
|
||||
const auto maybeEmpty = _list->empty();
|
||||
const auto knownEmpty = maybeEmpty && _entries->allLoaded;
|
||||
const auto filteredEmpty = knownEmpty && filter.skipsSomething();
|
||||
const auto collectionCanAdd = knownEmpty && descriptor.collectionId != 0;
|
||||
const auto collectionCanAdd = knownEmpty
|
||||
&& descriptor.collectionId != 0
|
||||
&& _peer->canManageGifts();
|
||||
if (filteredEmpty) {
|
||||
auto text = tr::lng_peer_gifts_empty_search(
|
||||
tr::now,
|
||||
@ -1087,10 +1089,12 @@ void InnerWidget::refreshCollectionsTabs() {
|
||||
.text = std::move(title),
|
||||
});
|
||||
}
|
||||
tabs.push_back({
|
||||
.id = u"add"_q,
|
||||
.text = { '+' + tr::lng_gift_collection_add(tr::now) },
|
||||
});
|
||||
if (_peer->canManageGifts()) {
|
||||
tabs.push_back({
|
||||
.id = u"add"_q,
|
||||
.text = { '+' + tr::lng_gift_collection_add(tr::now) },
|
||||
});
|
||||
}
|
||||
const auto context = Core::TextContext({
|
||||
.session = &_window->session(),
|
||||
});
|
||||
@ -1224,7 +1228,9 @@ void InnerWidget::fillMenu(const Ui::Menu::MenuCallback &addAction) {
|
||||
}, &st::menuIconAddToFolder);
|
||||
}
|
||||
|
||||
addAction({ .isSeparator = true });
|
||||
if (canManage || !descriptor.collectionId) {
|
||||
addAction({ .isSeparator = true });
|
||||
}
|
||||
|
||||
addAction(tr::lng_peer_gifts_filter_unlimited(tr::now), [=] {
|
||||
change([](Filter &filter) {
|
||||
@ -1339,12 +1345,13 @@ void Widget::refreshBottom() {
|
||||
const auto notify = _notifyEnabled.has_value();
|
||||
const auto descriptor = _descriptor.current();
|
||||
const auto shownId = descriptor.collectionId;
|
||||
const auto withButton = shownId && peer()->canManageGifts();
|
||||
const auto wasBottom = _pinnedToBottom ? _pinnedToBottom->height() : 0;
|
||||
delete _pinnedToBottom.data();
|
||||
if (!notify && !shownId) {
|
||||
if (!notify && !withButton) {
|
||||
setScrollBottomSkip(0);
|
||||
_hasPinnedToBottom = false;
|
||||
} else if (shownId) {
|
||||
} else if (withButton) {
|
||||
setupBottomButton(wasBottom);
|
||||
} else {
|
||||
setupNotifyCheckbox(wasBottom, *_notifyEnabled);
|
||||
|
Loading…
x
Reference in New Issue
Block a user