Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Fix display of room notification debug info (#12183)
Browse files Browse the repository at this point in the history
* Fix display of room notification debug info

 * Add 'one' string because apprently it just displays nothing at all
   if that's missing, rather than erroring or falling back to use the 'other'.
 * Simplify and always display the count: it's debug info so it's best to
   be very explicit anyway, plus simpler code & one less string.

* Update snapshot
  • Loading branch information
dbkr authored Jan 29, 2024
1 parent 11f45f5 commit 3f7e21e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 21 deletions.
30 changes: 10 additions & 20 deletions src/components/views/dialogs/devtools/RoomNotifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,26 +77,16 @@ export default function RoomNotifications({ onBack }: IDevtoolsProps): JSX.Eleme
<h2>{_t("devtools|room_status")}</h2>
<ul>
<li>
{count > 0
? _t(
"devtools|room_unread_status_count",
{
status: humanReadableNotificationLevel(level),
count,
},
{
strong: (sub) => <strong>{sub}</strong>,
},
)
: _t(
"devtools|room_unread_status",
{
status: humanReadableNotificationLevel(level),
},
{
strong: (sub) => <strong>{sub}</strong>,
},
)}
{_t(
"devtools|room_unread_status_count",
{
status: humanReadableNotificationLevel(level),
count,
},
{
strong: (sub) => <strong>{sub}</strong>,
},
)}
</li>
<li>
{_t(
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,8 @@
"room_notifications_total": "Total: ",
"room_notifications_type": "Type: ",
"room_status": "Room status",
"room_unread_status": "Room unread status: <strong>%(status)s</strong>",
"room_unread_status_count": {
"one": "Room unread status: <strong>%(status)s</strong>, count: <strong>%(count)s</strong>",
"other": "Room unread status: <strong>%(status)s</strong>, count: <strong>%(count)s</strong>"
},
"save_setting_values": "Save setting values",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ exports[`<RoomNotifications /> should render 1`] = `
<strong>
None
</strong>
, count:
<strong>
0
</strong>
</span>
</li>
<li>
Expand Down

0 comments on commit 3f7e21e

Please sign in to comment.