diff --git a/Telegram/SourceFiles/history/view/history_view_transcribe_button.cpp b/Telegram/SourceFiles/history/view/history_view_transcribe_button.cpp index 217563dc4..c0eb6bdd8 100644 --- a/Telegram/SourceFiles/history/view/history_view_transcribe_button.cpp +++ b/Telegram/SourceFiles/history/view/history_view_transcribe_button.cpp @@ -126,11 +126,15 @@ void TranscribeButton::setOpened(bool opened, Fn update) { return; } _opened = opened; - _openedAnimation.start( - std::move(update), - _opened ? 0. : 1., - _opened ? 1. : 0., - st::fadeWrapDuration); + if (update) { + _openedAnimation.start( + std::move(update), + _opened ? 0. : 1., + _opened ? 1. : 0., + st::fadeWrapDuration); + } else { + _openedAnimation.stop(); + } } ClickHandlerPtr TranscribeButton::link() { diff --git a/Telegram/SourceFiles/history/view/media/history_view_document.cpp b/Telegram/SourceFiles/history/view/media/history_view_document.cpp index 493a40a0d..b23323ead 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_document.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_document.cpp @@ -243,7 +243,8 @@ QSize Document::countOptimalSize() { voice->transcribe = nullptr; voice->transcribeText = {}; } else { - if (!voice->transcribe) { + const auto creating = !voice->transcribe; + if (creating) { voice->transcribe = std::make_unique( _realParent); } @@ -262,7 +263,9 @@ QSize Document::countOptimalSize() { : TextWithEntities{ entry.result + (entry.pending ? " [...]" : ""), }; - voice->transcribe->setOpened(!text.empty(), update); + voice->transcribe->setOpened( + !text.empty(), + creating ? Fn() : update); if (text.empty()) { voice->transcribeText = {}; } else {