From 5de33019d8c48c35b8da82d1f36414690ebfe11e Mon Sep 17 00:00:00 2001 From: Liam Date: Wed, 8 Nov 2023 00:28:28 +0000 Subject: [PATCH] fix(overlay): redirect to builder if no config was provided --- src/app/overlay/page.tsx | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/src/app/overlay/page.tsx b/src/app/overlay/page.tsx index b6f2629..7288b25 100644 --- a/src/app/overlay/page.tsx +++ b/src/app/overlay/page.tsx @@ -1,11 +1,9 @@ "use client"; -import Container from "@/components/Container"; import Spinner from "@/components/Spinner"; import PlayerStats from "@/components/overlay/PlayerStats"; import ScoreStats from "@/components/overlay/ScoreStats"; import SongInfo from "@/components/overlay/SongInfo"; -import { Card, CardDescription, CardTitle } from "@/components/ui/card"; import { HttpSiraStatus } from "@/overlay/httpSiraStatus"; import { OverlayPlayer } from "@/overlay/type/overlayPlayer"; import { BeatLeaderAPI } from "@/utils/beatleader/api"; @@ -104,6 +102,11 @@ export default class Overlay extends Component { render() { const { player, config, mounted } = this.state; + if (mounted && !config) { + window.location.href = "/overlay/builder"; + return null; + } + if (!mounted || (!player && config.settings.showPlayerStats)) { return (
@@ -113,33 +116,6 @@ export default class Overlay extends Component { ); } - if (!config) { - return ( -
- - - Overlay - -

- This page is meant to be used as an overlay for streaming. -

-

- To generate an overlay, go to the builder{" "} - - here - - . -

-
-
-
-
- ); - } - return (