compose: Correctly restore general-topic drafts.

This commit is contained in:
Karl Stolley
2025-02-10 17:45:57 -05:00
committed by Tim Abbott
parent a3a43c2f8b
commit dfb03251b0

View File

@@ -16,6 +16,7 @@ import * as messages_overlay_ui from "./messages_overlay_ui.ts";
import * as overlays from "./overlays.ts";
import * as people from "./people.ts";
import * as rendered_markdown from "./rendered_markdown.ts";
import {realm} from "./state_data.ts";
import * as user_card_popover from "./user_card_popover.ts";
import * as user_group_popover from "./user_group_popover.ts";
@@ -28,7 +29,10 @@ function restore_draft(draft_id: string): void {
const compose_args = {...drafts.restore_message(draft), draft_id};
if (compose_args.type === "stream") {
if (compose_args.stream_id !== undefined && compose_args.topic !== "") {
if (
compose_args.stream_id !== undefined &&
(compose_args.topic !== "" || !realm.realm_mandatory_topics)
) {
message_view.show(
[
{