fix(overlay): redirect to builder if no config was provided
All checks were successful
deploy / deploy (push) Successful in 1m3s
All checks were successful
deploy / deploy (push) Successful in 1m3s
This commit is contained in:
parent
bfe884a9e6
commit
5de33019d8
@ -1,11 +1,9 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import Container from "@/components/Container";
|
|
||||||
import Spinner from "@/components/Spinner";
|
import Spinner from "@/components/Spinner";
|
||||||
import PlayerStats from "@/components/overlay/PlayerStats";
|
import PlayerStats from "@/components/overlay/PlayerStats";
|
||||||
import ScoreStats from "@/components/overlay/ScoreStats";
|
import ScoreStats from "@/components/overlay/ScoreStats";
|
||||||
import SongInfo from "@/components/overlay/SongInfo";
|
import SongInfo from "@/components/overlay/SongInfo";
|
||||||
import { Card, CardDescription, CardTitle } from "@/components/ui/card";
|
|
||||||
import { HttpSiraStatus } from "@/overlay/httpSiraStatus";
|
import { HttpSiraStatus } from "@/overlay/httpSiraStatus";
|
||||||
import { OverlayPlayer } from "@/overlay/type/overlayPlayer";
|
import { OverlayPlayer } from "@/overlay/type/overlayPlayer";
|
||||||
import { BeatLeaderAPI } from "@/utils/beatleader/api";
|
import { BeatLeaderAPI } from "@/utils/beatleader/api";
|
||||||
@ -104,6 +102,11 @@ export default class Overlay extends Component<OverlayProps, OverlayState> {
|
|||||||
render() {
|
render() {
|
||||||
const { player, config, mounted } = this.state;
|
const { player, config, mounted } = this.state;
|
||||||
|
|
||||||
|
if (mounted && !config) {
|
||||||
|
window.location.href = "/overlay/builder";
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (!mounted || (!player && config.settings.showPlayerStats)) {
|
if (!mounted || (!player && config.settings.showPlayerStats)) {
|
||||||
return (
|
return (
|
||||||
<main className="flex items-center !bg-transparent p-3">
|
<main className="flex items-center !bg-transparent p-3">
|
||||||
@ -113,33 +116,6 @@ export default class Overlay extends Component<OverlayProps, OverlayState> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!config) {
|
|
||||||
return (
|
|
||||||
<main>
|
|
||||||
<Container>
|
|
||||||
<Card className="mt-2 p-3">
|
|
||||||
<CardTitle>Overlay</CardTitle>
|
|
||||||
<CardDescription className="mt-2">
|
|
||||||
<p>
|
|
||||||
This page is meant to be used as an overlay for streaming.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
To generate an overlay, go to the builder{" "}
|
|
||||||
<a
|
|
||||||
className="transform-gpu text-pp-blue transition-all hover:opacity-80"
|
|
||||||
href="/overlay/builder"
|
|
||||||
>
|
|
||||||
here
|
|
||||||
</a>
|
|
||||||
.
|
|
||||||
</p>
|
|
||||||
</CardDescription>
|
|
||||||
</Card>
|
|
||||||
</Container>
|
|
||||||
</main>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main>
|
<main>
|
||||||
<div>
|
<div>
|
||||||
|
Loading…
Reference in New Issue
Block a user