Fixed a bug in the End.jsx page
This commit is contained in:
parent
301a658287
commit
46b3f5952b
@ -5,6 +5,7 @@ import {GroupContext} from "@/common/contexts/GroupContext.jsx";
|
|||||||
import Sound from "react-sound";
|
import Sound from "react-sound";
|
||||||
import ThemeSound from "@/common/sounds/end.mp3";
|
import ThemeSound from "@/common/sounds/end.mp3";
|
||||||
import {MusicContext} from "@/common/contexts/MusicContext.jsx";
|
import {MusicContext} from "@/common/contexts/MusicContext.jsx";
|
||||||
|
import {Navigate} from "react-router";
|
||||||
|
|
||||||
const localeOptions = {
|
const localeOptions = {
|
||||||
style: "decimal",
|
style: "decimal",
|
||||||
@ -23,10 +24,13 @@ export const End = () => {
|
|||||||
socket.connect();
|
socket.connect();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
if (groups.length === 0 && allGroups.length === 0)
|
||||||
|
return <Navigate to="/"/>;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="end-page">
|
<div className="end-page">
|
||||||
<Sound url={ThemeSound} playStatus={Sound.status.PLAYING} volume={musicEnabled ? 50 : 0} loop={true}/>
|
<Sound url={ThemeSound} playStatus={Sound.status.PLAYING} volume={musicEnabled ? 50 : 0} loop={true}/>
|
||||||
{[...groups, ...allGroups].map(group => (
|
{[...groups, ...allGroups].sort((a, b) => b.capital - a.capital).map(group => (
|
||||||
<div key={group.id} className="glassy group">
|
<div key={group.id} className="glassy group">
|
||||||
<div className="group-item">
|
<div className="group-item">
|
||||||
<p>Unternehmen</p>
|
<p>Unternehmen</p>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user