fix: delay boss lore toasts until battle animation reveals result
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m3s
CI / Lint, Build & Test (push) Successful in 1m6s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 19:18:46 -07:00
committed by Naomi Carrigan
parent 5a065998b6
commit 6e2cb45553
2 changed files with 47 additions and 4 deletions
+8 -1
View File
@@ -58,7 +58,12 @@ const BattleModal = ({
onDismiss,
}: BattleModalProperties): JSX.Element => {
const { result, bossName } = battle;
const { enableNotifications, enableSounds, formatNumber } = useGame();
const {
enableNotifications,
enableSounds,
flushBossLoreToasts,
formatNumber,
} = useGame();
const [ phase, setPhase ] = useState<"animating" | "result">("animating");
@@ -111,6 +116,7 @@ const BattleModal = ({
const revealTimeout = setTimeout(() => {
setPhase("result");
flushBossLoreToasts();
if (result.won) {
if (enableSounds) {
playSound("bossVictory");
@@ -132,6 +138,7 @@ const BattleModal = ({
bossStartPercent,
enableNotifications,
enableSounds,
flushBossLoreToasts,
partyEndPercent,
result.won,
]);