Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
unread_ops: Change modal text for mark as unread confirmation modal.
Pratik Chandabaa5618771de
diff --git a/web/src/unread_ops.ts b/web/src/unread_ops.tsindex 25d3bc9b229..f42a1a41c22 100644--- a/web/src/unread_ops.ts+++ b/web/src/unread_ops.ts@@ -4,7 +4,6 @@ import assert from "minimalistic-assert";import * as z from "zod/mini";import render_confirm_mark_messages_as_read from "../templates/confirm_dialog/confirm_mark_all_as_read.hbs";-import render_confirm_mark_as_unread_from_here from "../templates/confirm_dialog/confirm_mark_as_unread_from_here.hbs";import render_skipped_marking_unread from "../templates/skipped_marking_unread.hbs";import * as blueslip from "./blueslip.ts";@@ -449,27 +448,29 @@ export function mark_as_unread_from_here(message_id: number): void {display_count = `${rounded_count}+`;}- const context = {- // If we don't know how many messages will be affected, but- // can't prove the number is more than 10, we avoid showing a- // count, since it just seems weird to say "3+ messages will- // be marked as read".- //- // It's not obvious this case is worth having special strings- // for, given how unlikely it is. A sample scenario is that- // we're be that we're near the fetched bottom of a /near/1- // search view where can_apply_locally is false, which will- // have triggered a request for the next batch of messages- // from the server, but that request has not returned. But it- // may happen more offline if the client is intermittantly- // offline.- show_message_count: locally_available_message_count >= MIN_MARK_AS_UNREAD_COUNT_LOWER_BOUND,- count: display_count,- };+ // If we don't know how many messages will be affected, but+ // can't prove the number is more than 10, we avoid showing a+ // count, since it just seems weird to say "3+ messages will+ // be marked as read".+ //+ // It's not obvious this case is worth having special strings+ // for, given how unlikely it is. A sample scenario is that+ // we're be that we're near the fetched bottom of a /near/1+ // search view where can_apply_locally is false, which will+ // have triggered a request for the next batch of messages+ // from the server, but that request has not returned. But it+ // may happen more offline if the client is intermittantly+ // offline.+ const show_message_count =+ locally_available_message_count >= MIN_MARK_AS_UNREAD_COUNT_LOWER_BOUND;confirm_dialog.launch({- modal_title_html: $t_html({defaultMessage: "Mark messages as unread?"}),- modal_content_html: render_confirm_mark_as_unread_from_here(context),+ modal_title_html: show_message_count+ ? $t_html({defaultMessage: "Mark {display_count} messages as unread?"}, {display_count})+ : $t_html({defaultMessage: "Mark messages as unread?"}),+ modal_content_html: $t_html({+ defaultMessage: "Messages in multiple conversations may be affected.",+ }),is_compact: true,on_click() {if (prefer_local_ids) {diff --git a/web/templates/confirm_dialog/confirm_mark_as_unread_from_here.hbs b/web/templates/confirm_dialog/confirm_mark_as_unread_from_here.hbsdeleted file mode 100644index 6c3d0a22c31..00000000000--- a/web/templates/confirm_dialog/confirm_mark_as_unread_from_here.hbs+++ /dev/null@@ -1,5 +0,0 @@-{{#if show_message_count}}- {{t "Are you sure you want to mark {count} messages as unread? Messages in multiple conversations may be affected."}}-{{else}}- {{t "Are you sure you want to mark messages as unread? Messages in multiple conversations may be affected."}}-{{/if}}