From beb2e7dc195546694dc084504fb75773bfebde63 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Tue, 9 Jun 2020 11:52:42 +0300 Subject: [PATCH] Fixed ability to open more than one calendar in schedule box. --- .../SourceFiles/history/view/history_view_schedule_box.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history/view/history_view_schedule_box.cpp b/Telegram/SourceFiles/history/view/history_view_schedule_box.cpp index d6196934a..0a329c2fb 100644 --- a/Telegram/SourceFiles/history/view/history_view_schedule_box.cpp +++ b/Telegram/SourceFiles/history/view/history_view_schedule_box.cpp @@ -672,8 +672,12 @@ void ScheduleBox( width); }, content->lifetime()); + const auto calendar = + content->lifetime().make_state>(); QObject::connect(dayInput, &Ui::InputField::focused, [=] { - const auto calendar = std::make_shared>(); + if (*calendar) { + return; + } const auto chosen = [=](QDate chosen) { *date = chosen; (*calendar)->closeBox();