Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

drafts: Fix implicit use of any.

Anders Kaseorg467e5a436160
diff --git a/web/src/drafts.ts b/web/src/drafts.ts
index 9d7ff615ab2..71a74a248f8 100644
--- a/web/src/drafts.ts
+++ b/web/src/drafts.ts
@@ -389,8 +389,9 @@ type UpdateDraftOptions = {
};
export function update_draft(opts: UpdateDraftOptions = {}): string | undefined {
- const draft_id = $("textarea#compose-textarea").data("draft-id");
- const old_draft = draft_model.getDraft(draft_id);
+ const draft_id: unknown = $("textarea#compose-textarea").data("draft-id");
+ assert(draft_id === undefined || typeof draft_id === "string");
+ const old_draft = draft_id === undefined ? undefined : draft_model.getDraft(draft_id);
const no_notify = opts.no_notify ?? false;
const draft = snapshot_message();