From ccc96edfaf1201dc2264b3d615d1fb6530109934 Mon Sep 17 00:00:00 2001 From: zesuca Date: Fri, 6 Feb 2026 10:48:41 +0100 Subject: [PATCH] fix: reverse ordering of calls --- src/components/calls-page/calls-page.tsx | 9 ++-- .../calls-page/production-lines.tsx | 43 ++++++++++--------- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/src/components/calls-page/calls-page.tsx b/src/components/calls-page/calls-page.tsx index 62958206..070b5c94 100644 --- a/src/components/calls-page/calls-page.tsx +++ b/src/components/calls-page/calls-page.tsx @@ -94,9 +94,12 @@ export const CallsPage = () => { useEffect(() => { callIndexMap.current = {}; - Object.keys(calls).forEach((callId, i) => { - callIndexMap.current[i + 1] = callId; - }); + Object.keys(calls) + .slice() + .reverse() + .forEach((callId, i) => { + callIndexMap.current[i + 1] = callId; + }); }, [calls]); usePreventPullToRefresh(); diff --git a/src/components/calls-page/production-lines.tsx b/src/components/calls-page/production-lines.tsx index b5b1b770..54b9cfd2 100644 --- a/src/components/calls-page/production-lines.tsx +++ b/src/components/calls-page/production-lines.tsx @@ -35,26 +35,29 @@ export const ProductionLines = ({ }: ProductionLinesProps) => { return ( <> - {Object.entries(calls).map( - ([callId, callState]) => - callId && - callState.joinProductionOptions && ( - setAddCallActive(true)} - isSettingGlobalMute={isSettingGlobalMute} - callActionHandlers={callActionHandlers} - registerCallList={registerCallList} - deregisterCall={deregisterCall} - /> - ) - )} + {Object.entries(calls) + .slice() + .reverse() + .map( + ([callId, callState]) => + callId && + callState.joinProductionOptions && ( + setAddCallActive(true)} + isSettingGlobalMute={isSettingGlobalMute} + callActionHandlers={callActionHandlers} + registerCallList={registerCallList} + deregisterCall={deregisterCall} + /> + ) + )} ); };