generated from nhcarrigan/template
fix: save character name correctly and show story on character sheet
- Load route syncs characterName from Player record so profile updates are reflected immediately on next load - Save route preserves Player record's characterName so auto-saves cannot overwrite profile updates - Public profile response now includes completedChapters - Character sheet panel displays completed story chapters with outcome - Removed stale CSS for old achievement/codex toast classes
This commit is contained in:
@@ -657,6 +657,15 @@ const CharacterSheetPanel = (): JSX.Element => {
|
||||
if (choice === undefined) {
|
||||
return null;
|
||||
}
|
||||
const characterName
|
||||
= player?.characterName === ""
|
||||
|| player?.characterName === undefined
|
||||
? "the guild leader"
|
||||
: player.characterName;
|
||||
const outcome = choice.outcome.replaceAll(
|
||||
"{characterName}",
|
||||
characterName,
|
||||
);
|
||||
return (
|
||||
<div
|
||||
className="character-sheet-story-entry"
|
||||
@@ -668,6 +677,7 @@ const CharacterSheetPanel = (): JSX.Element => {
|
||||
<span className="character-sheet-story-choice">
|
||||
{choice.label}
|
||||
</span>
|
||||
<p className="character-sheet-story-outcome">{outcome}</p>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -4386,3 +4386,10 @@ body {
|
||||
font-size: 0.8rem;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.character-sheet-story-outcome {
|
||||
margin: 0;
|
||||
color: var(--colour-muted);
|
||||
font-size: 0.8rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user