diff --git a/src/Faction/ui/FactionsRoot.tsx b/src/Faction/ui/FactionsRoot.tsx index ccd57d556..46bfdf5e2 100644 --- a/src/Faction/ui/FactionsRoot.tsx +++ b/src/Faction/ui/FactionsRoot.tsx @@ -19,6 +19,7 @@ import { IRouter } from "../../ui/Router"; import { Faction } from "../Faction"; import { joinFaction } from "../FactionHelpers"; import { Factions } from "../Factions"; +import { FactionNames } from "../data/FactionNames"; export const InvitationsSeen: string[] = []; @@ -79,9 +80,10 @@ 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)); + + const allFactions = Object.values(FactionNames).map(faction => faction as string) + const allJoinedFactions = props.player.factions.sort((a, b) => + allFactions.indexOf(a) - allFactions.indexOf(b)); return (