mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 13:17:08 +02:00
fix: close confirmation box
This commit is contained in:
parent
b3225af685
commit
1e34bc6b30
1 changed files with 11 additions and 9 deletions
|
@ -43,7 +43,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
// AyuGram includes
|
||||
#include "ayu/ayu_settings.h"
|
||||
#include "boxes/abstract_box.h"
|
||||
|
||||
#include "window/window_controller.h"
|
||||
|
||||
namespace HistoryView::Controls {
|
||||
namespace {
|
||||
|
@ -1713,7 +1713,7 @@ void VoiceRecordBar::stopRecording(StopType type, bool ttlBeforeHide) {
|
|||
};
|
||||
|
||||
auto settings = &AyuSettings::getInstance();
|
||||
auto sendVoiceCallback = crl::guard(this, [=, this]
|
||||
auto sendVoiceCallback = crl::guard(this, [=, this](Fn<void()> &&close)
|
||||
{
|
||||
_sendVoiceRequests.fire({
|
||||
data.bytes,
|
||||
|
@ -1721,18 +1721,19 @@ void VoiceRecordBar::stopRecording(StopType type, bool ttlBeforeHide) {
|
|||
duration,
|
||||
options,
|
||||
});
|
||||
close();
|
||||
});
|
||||
|
||||
if (settings->voiceConfirmation) {
|
||||
Ui::show(Ui::MakeConfirmBox(
|
||||
_show->showBox(Ui::MakeConfirmBox(
|
||||
{
|
||||
.text = tr::ayu_ConfirmationVoice(),
|
||||
.confirmed = sendVoiceCallback,
|
||||
.confirmed = std::move(sendVoiceCallback),
|
||||
.confirmText = tr::lng_send_button()
|
||||
}));
|
||||
}
|
||||
else {
|
||||
sendVoiceCallback();
|
||||
sendVoiceCallback([]{});
|
||||
}
|
||||
} else if (type == StopType::Listen) {
|
||||
_listen = std::make_unique<ListenWrap>(
|
||||
|
@ -1808,7 +1809,7 @@ void VoiceRecordBar::requestToSendWithOptions(Api::SendOptions options) {
|
|||
}
|
||||
|
||||
auto settings = &AyuSettings::getInstance();
|
||||
auto sendVoiceCallback = crl::guard(this, [=, this]
|
||||
auto sendVoiceCallback = crl::guard(this, [=, this](Fn<void()> &&close)
|
||||
{
|
||||
_sendVoiceRequests.fire({
|
||||
data->bytes,
|
||||
|
@ -1816,18 +1817,19 @@ void VoiceRecordBar::requestToSendWithOptions(Api::SendOptions options) {
|
|||
Duration(data->samples),
|
||||
options,
|
||||
});
|
||||
close();
|
||||
});
|
||||
|
||||
if (settings->voiceConfirmation) {
|
||||
Ui::show(Ui::MakeConfirmBox(
|
||||
_show->showBox(Ui::MakeConfirmBox(
|
||||
{
|
||||
.text = tr::ayu_ConfirmationVoice(),
|
||||
.confirmed = sendVoiceCallback,
|
||||
.confirmed = std::move(sendVoiceCallback),
|
||||
.confirmText = tr::lng_send_button()
|
||||
}));
|
||||
}
|
||||
else {
|
||||
sendVoiceCallback();
|
||||
sendVoiceCallback([]{});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue