mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Fix crash in restrict-from-recent-actions.
This commit is contained in:
@@ -942,20 +942,27 @@ void EditRestrictedBox::prepare() {
|
||||
if (!_saveCallback) {
|
||||
return;
|
||||
}
|
||||
const auto show = uiShow();
|
||||
const auto rankPeer = peer();
|
||||
const auto rankUser = user();
|
||||
const auto rank = _tagControl
|
||||
? _tagControl->currentRank()
|
||||
: _oldRank;
|
||||
const auto saveRank = (rank != _oldRank);
|
||||
|
||||
// May destroy the box.
|
||||
_saveCallback(
|
||||
_oldRights,
|
||||
ChatRestrictionsInfo{ value(), getRealUntilValue() });
|
||||
if (_tagControl) {
|
||||
const auto rank = _tagControl->currentRank();
|
||||
if (rank != _oldRank) {
|
||||
SaveMemberRank(
|
||||
uiShow(),
|
||||
peer(),
|
||||
user(),
|
||||
rank,
|
||||
nullptr,
|
||||
nullptr);
|
||||
}
|
||||
|
||||
if (saveRank) {
|
||||
SaveMemberRank(
|
||||
show,
|
||||
rankPeer,
|
||||
rankUser,
|
||||
rank,
|
||||
nullptr,
|
||||
nullptr);
|
||||
}
|
||||
};
|
||||
addButton(tr::lng_settings_save(), save);
|
||||
|
||||
Reference in New Issue
Block a user