From 73f157d769dc7969d9763ba757066733e06ed2a2 Mon Sep 17 00:00:00 2001 From: Half-Shot Date: Tue, 16 Dec 2025 12:50:51 +0000 Subject: [PATCH] fix loop --- .../rooms/RoomStatusBarViewModel.tsx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/components/viewmodels/rooms/RoomStatusBarViewModel.tsx b/src/components/viewmodels/rooms/RoomStatusBarViewModel.tsx index 25c5578d62..5a39d0066a 100644 --- a/src/components/viewmodels/rooms/RoomStatusBarViewModel.tsx +++ b/src/components/viewmodels/rooms/RoomStatusBarViewModel.tsx @@ -100,16 +100,14 @@ export function useRoomStatusBarViewModel({ room }: IProps): RoomStatusBarVM { let consentError: MatrixError | null = null; let resourceLimitError: MatrixError | null = null; for (const m of unsentMessages) { - if (!m.error) { - continue; - } - if (m.error.errcode === "M_CONSENT_NOT_GIVEN") { - consentError = m.error; - break; - } - if (m.error.errcode === "M_RESOURCE_LIMIT_EXCEEDED") { - resourceLimitError = m.error; - break; + if (m.error) { + if (m.error.errcode === "M_RESOURCE_LIMIT_EXCEEDED") { + resourceLimitError = m.error; + } + if (m.error.errcode === "M_CONSENT_NOT_GIVEN") { + consentError = m.error; + break; // This is the most important thing to show, so break here if we find one. + } } } if (consentError) {