Skip to content

Commit

Permalink
fix: better wait time on bar view
Browse files Browse the repository at this point in the history
  • Loading branch information
domysh committed Jun 22, 2024
1 parent 4f4322c commit 7844d45
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/components/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { PiSwordBold } from "react-icons/pi";
import { MdGroups } from "react-icons/md";
import { useNavigate, useParams } from "react-router";
import { useInterval } from "@mantine/hooks";
import { secondDurationToString } from "@/utils/time";

export const HomePage = () => {
const { page } = useParams()
Expand Down Expand Up @@ -71,7 +72,7 @@ export const HomePage = () => {
{messages?<>{messages}<Space h="lg" /></>:null}
{nextTickIn==Infinity?"Waiting for the first attack":
nextTickIn==-2?"Game ended! 👾":<>
Next tick in: {nextTickIn == -1?"Not started yet :(":`${nextTickIn.toFixed(0)} s`}
Next tick in: {nextTickIn == -1?"Not started yet :(":`${secondDurationToString(parseInt(nextTickIn.toFixed(0)))}`}
</>}
<Progress color={nextTickIn!=-2?"red":"lime"} radius="md" size="xl" value={nextTickIn==-2?100:(nextTickIn/tickTime)*100} striped={nextTickIn!=-2} animated={nextTickIn!=-2} />
<Space h="lg" />
Expand Down

0 comments on commit 7844d45

Please sign in to comment.