UI: Version + Nightly-Badge nur im Nightly-Build anzeigen; CI: :latest nur auf main

This commit is contained in:
vibe-bot 2025-08-09 16:14:46 +02:00
parent 55a0c0d65e
commit 138f56d100

View file

@ -30,7 +30,6 @@ export default function App() {
const [chaosMode, setChaosMode] = useState<boolean>(false);
const chaosTimeoutRef = useRef<number | null>(null);
const chaosModeRef = useRef<boolean>(false);
const [buildInfo, setBuildInfo] = useState<{version: string, channel: string}>({version: '1.0.0', channel: 'stable'});
useEffect(() => { chaosModeRef.current = chaosMode; }, [chaosMode]);
useEffect(() => {
@ -51,7 +50,6 @@ export default function App() {
try {
const h = await fetch('/api/health').then(r => r.json()).catch(() => null);
if (h && typeof h.totalPlays === 'number') setTotalPlays(h.totalPlays);
if (h && h.buildInfo) setBuildInfo(h.buildInfo);
} catch {}
})();
}, []);
@ -117,7 +115,6 @@ export default function App() {
try {
const h = await fetch('/api/health').then(r => r.json()).catch(() => null);
if (h && typeof h.totalPlays === 'number') setTotalPlays(h.totalPlays);
if (h && h.buildInfo) setBuildInfo(h.buildInfo);
} catch {}
};
@ -257,12 +254,12 @@ export default function App() {
<div>
<h1 className="text-4xl font-bold">
Jukebox 420
{import.meta.env.VITE_BUILD_CHANNEL === 'nightly' && (
<div className="text-sm font-normal mt-1 opacity-70">
v{buildInfo.version}
{buildInfo.channel === 'nightly' && (
v{import.meta.env.VITE_APP_VERSION || ''}
<span className="ml-2" style={{ color: '#ff4d4f' }}> Nightly</span>
)}
</div>
)}
</h1>
<p className="text-7xl font-bold mt-2">{clock}</p>
</div>