mirror of https://github.com/zulip/zulip.git
drafts: Delete old drafts on page load, not modal launch.
This fixes a bad user experience where clicking to open the drafts modal causes the number of drafts that you're looking at to suddenly change.
This commit is contained in:
parent
49eab4efef
commit
8f74261d48
|
@ -201,8 +201,6 @@ test("remove_old_drafts", () => {
|
|||
});
|
||||
|
||||
test("format_drafts", ({override, mock_template}) => {
|
||||
override(drafts, "remove_old_drafts", noop);
|
||||
|
||||
function feb12() {
|
||||
return new Date(1549958107000); // 2/12/2019 07:55:07 AM (UTC+0)
|
||||
}
|
||||
|
|
|
@ -389,7 +389,6 @@ export function launch() {
|
|||
});
|
||||
}
|
||||
|
||||
remove_old_drafts();
|
||||
const drafts = format_drafts(draft_model.get());
|
||||
render_widgets(drafts);
|
||||
|
||||
|
@ -551,6 +550,8 @@ export function set_initial_element(drafts) {
|
|||
}
|
||||
|
||||
export function initialize() {
|
||||
remove_old_drafts();
|
||||
|
||||
window.addEventListener("beforeunload", () => {
|
||||
update_draft();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue