settings: Indicate character limit on restoring long draft messages.

Currently, when restoring drafts with long
messages no character limit or the compose
banner is shown.

We fix this by adding a check for text
overflow whenever any draft is restored.
This commit is contained in:
Sahil Singh 2023-02-12 16:21:24 +05:30 committed by Tim Abbott
parent 845e873c44
commit 183f5016a1
1 changed files with 2 additions and 0 deletions

View File

@ -15,6 +15,7 @@ import * as compose_actions from "./compose_actions";
import * as compose_fade from "./compose_fade"; import * as compose_fade from "./compose_fade";
import * as compose_state from "./compose_state"; import * as compose_state from "./compose_state";
import * as compose_ui from "./compose_ui"; import * as compose_ui from "./compose_ui";
import * as compose_validate from "./compose_validate";
import * as confirm_dialog from "./confirm_dialog"; import * as confirm_dialog from "./confirm_dialog";
import {$t, $t_html} from "./i18n"; import {$t, $t_html} from "./i18n";
import {localstorage} from "./localstorage"; import {localstorage} from "./localstorage";
@ -319,6 +320,7 @@ export function restore_draft(draft_id) {
compose_actions.start(compose_args.type, compose_args); compose_actions.start(compose_args.type, compose_args);
compose_ui.autosize_textarea($("#compose-textarea")); compose_ui.autosize_textarea($("#compose-textarea"));
$("#compose-textarea").data("draft-id", draft_id); $("#compose-textarea").data("draft-id", draft_id);
compose_validate.check_overflow_text();
} }
const DRAFT_LIFETIME = 30; const DRAFT_LIFETIME = 30;