mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
compose: Retain compose state across narrows if recipient was edited.
Uptil now, the compose box's state was retained across narrows only if the compose box had any content in it. Else it was reset to match the current narrow. To not lose any changes made to the recipient fields only, the compose box will now retain its state also if the recipient (stream, topic or PMs) has been manually edited. This is achieved by having a variable in `compose_state` track if the recipient fields were changed, and checking it before resetting the compose box on narrowing. This variable is reset when the compose box's context is changed by clicking on a message, or when a message is sent. Fixes: #23064.
This commit is contained in:
@@ -3,6 +3,15 @@ import $ from "jquery";
|
||||
import * as compose_pm_pill from "./compose_pm_pill";
|
||||
|
||||
let message_type = false; // 'stream', 'private', or false-y
|
||||
let recipient_edited_manually = false;
|
||||
|
||||
export function set_recipient_edited_manually(flag) {
|
||||
recipient_edited_manually = flag;
|
||||
}
|
||||
|
||||
export function is_recipient_edited_manually() {
|
||||
return recipient_edited_manually;
|
||||
}
|
||||
|
||||
export function set_message_type(msg_type) {
|
||||
message_type = msg_type;
|
||||
|
||||
Reference in New Issue
Block a user