Compare commits
No commits in common. "8e10b9e5852c974e1a45824af118488ea6dcd920" and "404a23b2e109144bc4f02d1f3cbc0d0183acc6c4" have entirely different histories.
8e10b9e585
...
404a23b2e1
@ -5,7 +5,6 @@ import bgStyles from "../styles/Background.module.css";
|
||||
import { bossToName, bossToReward } from "./BossInfo";
|
||||
import { bossLevelToClass } from "./Boss";
|
||||
import { lostSound, wonSound } from "../utils/soundsEffect";
|
||||
import { useEffect } from "react";
|
||||
|
||||
interface BossOutcomeModalProps {
|
||||
setIsOpen: (val: boolean) => void;
|
||||
@ -13,19 +12,16 @@ interface BossOutcomeModalProps {
|
||||
|
||||
const BossOutcomeModal = ({ setIsOpen }: BossOutcomeModalProps) => {
|
||||
const { lastBossResult } = usePlayer();
|
||||
const outcome = lastBossResult?.reward != BigInt(0);
|
||||
const ascended = lastBossResult?.prestigeGained;
|
||||
useEffect(() => {
|
||||
if (lastBossResult != null) {
|
||||
if (lastBossResult == null) return null;
|
||||
|
||||
const outcome = lastBossResult.reward != BigInt(0);
|
||||
const ascended = lastBossResult.prestigeGained;
|
||||
|
||||
if (outcome) {
|
||||
wonSound();
|
||||
} else {
|
||||
lostSound();
|
||||
}
|
||||
}
|
||||
}, [outcome, lastBossResult])
|
||||
|
||||
if (lastBossResult == null) return null;
|
||||
|
||||
const text = outcome ? (
|
||||
<span>
|
||||
|
||||
@ -29,7 +29,6 @@ export const clickSound = () => {
|
||||
export const lostSound = () => {
|
||||
const fail = new Howl({
|
||||
src: ["/sounds/lost.wav"],
|
||||
volume: 0.7
|
||||
});
|
||||
|
||||
fail.play();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user