Skip to content

Commit

Permalink
Better spot name changes formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
squaresmile committed Nov 9, 2023
1 parent 8e42a33 commit be8f31a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/db/src/Page/WarPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import EntityReferenceDescriptor from "../Descriptor/EntityReferenceDescriptor";
import GiftDescriptor from "../Descriptor/GiftDescriptor";
import { QuestTypeDescription } from "../Descriptor/QuestEnumDescription";
import ScriptDescriptor from "../Descriptor/ScriptDescriptor";
import { dedupe } from "../Helper/ArrayHelper";
import { Renderable, mergeElements } from "../Helper/OutputHelper";
import { FGOText, removeSuffix } from "../Helper/StringHelper";
import Manager, { lang } from "../Setting/Manager";
Expand Down Expand Up @@ -348,15 +349,16 @@ const Spot = (props: {

if (filteredQuest.length === 0) return null;

const spotNameChanges = spot.spotAdds
.filter((spotAdd) => spotAdd.overrideType === War.SpotOverwriteType.NAME)
.map((spotAdd) => `/ ${spotAdd.targetText}`)
.join("");
const spotNameChanges = dedupe(
spot.spotAdds
.filter((spotAdd) => spotAdd.overrideType === War.SpotOverwriteType.NAME)
.map((spotAdd) => spotAdd.targetText)
).join(" / ");

const title = (
<span lang={lang(region)}>
<SpotImage src={spot.image} name={spot.name} height="1.5em" />
<FGOText text={spot.name} /> <FGOText text={spotNameChanges} />
<FGOText text={spot.name} /> {spotNameChanges !== "" && "/"} <FGOText text={spotNameChanges} />
</span>
);

Expand Down

0 comments on commit be8f31a

Please sign in to comment.