Discard empty rich-page drafts on save.

This commit is contained in:
John Preston
2026-07-08 21:11:41 +04:00
parent 253e571281
commit 3df3936ed2
@@ -3664,6 +3664,11 @@ std::optional<::Data::Draft> ArticleSession::prepareRichDraftForAutosave() const
draft.webpage = ::Data::WebPageDraft();
draft.reply.topicRootId = topicRootId;
draft.reply.monoforumPeerId = monoforumPeerId;
if (_state->articleEmpty()) {
draft.richMessage = nullptr;
draft.richMessageSummary = {};
return draft;
}
if (auto simple = SerializeAsSimple(_state->richPage(), _session)) {
draft.textWithTags = {
simple->text,