mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 06:18:42 +02:00
UI: Prevent joining banned factions via UI (#2573)
This commit is contained in:
@@ -44,7 +44,7 @@ export function FactionInvitationManager({ hidden }: { hidden: boolean }): React
|
||||
|
||||
function close(): void {
|
||||
setFactions((currentFactions) => {
|
||||
return currentFactions.slice(1);
|
||||
return currentFactions.slice(1).filter((name) => !Factions[name].isBanned);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ export function FactionInvitationManager({ hidden }: { hidden: boolean }): React
|
||||
const enemies = faction?.getInfo().enemies ?? [];
|
||||
|
||||
function join(): void {
|
||||
if (faction === null || !faction.alreadyInvited) {
|
||||
if (faction === null || !faction.alreadyInvited || faction.isBanned) {
|
||||
return;
|
||||
}
|
||||
joinFaction(faction);
|
||||
|
||||
@@ -85,9 +85,11 @@ const FactionElement = (props: FactionElementProps): React.ReactElement => {
|
||||
Router.toPage(Page.FactionAugmentations, { faction });
|
||||
}
|
||||
|
||||
function acceptInvitation(event: React.MouseEvent<HTMLButtonElement>, faction: FactionName): void {
|
||||
if (!event.isTrusted) return;
|
||||
joinFaction(Factions[faction]);
|
||||
function acceptInvitation(event: React.MouseEvent<HTMLButtonElement>, factionName: FactionName): void {
|
||||
if (!event.isTrusted || !Factions[factionName].alreadyInvited || Factions[factionName].isBanned) {
|
||||
return;
|
||||
}
|
||||
joinFaction(Factions[factionName]);
|
||||
props.rerender();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user