From deca64cd3ead7405bb3f225afa98c78079ccca40 Mon Sep 17 00:00:00 2001 From: vova-zush Date: Tue, 23 Mar 2021 01:19:55 +0200 Subject: [PATCH] [FIX] undefined in PruneMessages deleting DM (#20873) --- .../views/room/contextualBar/PruneMessages/PruneMessages.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/views/room/contextualBar/PruneMessages/PruneMessages.js b/client/views/room/contextualBar/PruneMessages/PruneMessages.js index 22314823f8b..7a299723418 100644 --- a/client/views/room/contextualBar/PruneMessages/PruneMessages.js +++ b/client/views/room/contextualBar/PruneMessages/PruneMessages.js @@ -152,7 +152,7 @@ export default ({ const room = useUserRoom(rid); room.type = room.t; room.rid = rid; - const { name } = room; + const { name, usernames } = room; const setModal = useSetModal(); const onClickClose = useMutableCallback(() => tabBar && tabBar.close()); @@ -272,7 +272,7 @@ export default ({ } else { setCallOutText(t('Prune_Warning_all', { postProcess: 'sprintf', - sprintf: [filesOrMessages, name], + sprintf: [filesOrMessages, name || usernames?.join(' x ')], }) + exceptPinned + ifFrom); } @@ -290,7 +290,7 @@ export default ({ } setValidateText(); - }, [newerDate, olderDate, fromDate, toDate, attached, name, t, pinned, users]); + }, [newerDate, olderDate, fromDate, toDate, attached, name, t, pinned, users, usernames]); return (