From 5532b81285ef5d02e274eb590b6074f232c415b8 Mon Sep 17 00:00:00 2001 From: phyzical Date: Mon, 21 Mar 2022 20:13:28 +0800 Subject: [PATCH] add similar sort to the faction invite list --- src/Faction/ui/FactionsRoot.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Faction/ui/FactionsRoot.tsx b/src/Faction/ui/FactionsRoot.tsx index 45e750232..ccd57d556 100644 --- a/src/Faction/ui/FactionsRoot.tsx +++ b/src/Faction/ui/FactionsRoot.tsx @@ -79,6 +79,9 @@ export function FactionsRoot(props: IProps): React.ReactElement { (augmentation: string) => !player.hasAugmentation(augmentation) ).length; } + let allJoinedFactions = props.player.factions + allJoinedFactions = allJoinedFactions.sort((a, b) => + allJoinedFactions.indexOf(a) - allJoinedFactions.indexOf(b)); return ( @@ -92,11 +95,11 @@ export function FactionsRoot(props: IProps): React.ReactElement { Factions you have joined: - {(props.player.factions.length > 0 && ( + {(allJoinedFactions.length > 0 && ( - {props.player.factions.map((faction: string) => ( + {allJoinedFactions.map((faction: string) => (