2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-03 16:15:13 +00:00

Fix reopening of recent actions section

This commit is contained in:
RadRussianRus
2021-04-07 05:37:17 +03:00
parent 358e5cb18f
commit 782ccde92a
3 changed files with 12 additions and 2 deletions

View File

@@ -984,8 +984,10 @@ void ManageFiller::addChannelRecentActions(
tr::lng_manage_peer_recent_actions(), tr::lng_manage_peer_recent_actions(),
rpl::single(true), rpl::single(true),
[=] { [=] {
controller->showSection( if (!App::main()->areRecentActionsOpened()) {
std::make_shared<AdminLog::SectionMemento>(channel)); controller->showSection(
std::make_shared<AdminLog::SectionMemento>(channel));
}
}); });
object_ptr<FloatingIcon>( object_ptr<FloatingIcon>(
button, button,

View File

@@ -61,6 +61,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/history.h" #include "history/history.h"
#include "history/history_widget.h" #include "history/history_widget.h"
#include "history/history_message.h" #include "history/history_message.h"
#include "history/admin_log/history_admin_log_section.h"
#include "history/view/media/history_view_media.h" #include "history/view/media/history_view_media.h"
#include "history/view/history_view_service_message.h" #include "history/view/history_view_service_message.h"
#include "history/view/history_view_element.h" #include "history/view/history_view_element.h"
@@ -1941,6 +1942,11 @@ bool MainWidget::preventsCloseSection(
: preventsCloseSection(std::move(callback)); : preventsCloseSection(std::move(callback));
} }
bool MainWidget::areRecentActionsOpened() {
return _mainSection
&& static_cast<AdminLog::Widget*>(_mainSection.data());
}
void MainWidget::showBackFromStack( void MainWidget::showBackFromStack(
const SectionShow &params) { const SectionShow &params) {

View File

@@ -241,6 +241,8 @@ public:
Fn<void()> callback, Fn<void()> callback,
const SectionShow &params) const; const SectionShow &params) const;
bool areRecentActionsOpened();
public Q_SLOTS: public Q_SLOTS:
void inlineResultLoadProgress(FileLoader *loader); void inlineResultLoadProgress(FileLoader *loader);
void inlineResultLoadFailed(FileLoader *loader, bool started); void inlineResultLoadFailed(FileLoader *loader, bool started);