generated from nhcarrigan/template
fix: delay boss lore toasts until battle animation reveals result
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user