2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-29 13:39:06 +00:00

Fixed stuck of FieldHeader when invalid link was provided.

This commit is contained in:
23rd 2020-07-20 14:41:47 +03:00
parent 01fd8aded1
commit 5a46bb1770

View File

@ -351,7 +351,7 @@ bool FieldHeader::isEditingMessage() const {
}
bool FieldHeader::hasPreview() const {
return _preview.data != nullptr;
return ShowWebPagePreview(_preview.data);
}
WebPageId FieldHeader::webPageId() const {
@ -1013,6 +1013,13 @@ void ComposeControls::initWebpageProcess() {
requestRepaint
), lifetime);
_window->session().data().webPageUpdates(
) | rpl::filter([=](not_null<WebPageData*> page) {
return (*previewData == page.get());
}) | rpl::start_with_next([=] {
updatePreview();
}, lifetime);
const auto fieldLinksParser =
lifetime.make_state<MessageLinksParser>(_field);