diff --git a/frontend/src/components/NavBar.vue b/frontend/src/components/NavBar.vue index c325c08..6c6a8e1 100644 --- a/frontend/src/components/NavBar.vue +++ b/frontend/src/components/NavBar.vue @@ -8,8 +8,8 @@ const { bot, isLoggedIn } = useNostr() const isMenuOpen = ref(false) const links = [ - { to: '/join', label: 'JOIN A BOUT' }, - { to: '/arena', label: 'ARENA' }, + { to: '/join', label: 'FIGHT!' }, + { to: '/arena', label: 'WATCH' }, { to: '/leaderboard', label: 'RANKINGS' }, ] diff --git a/frontend/src/pages/FightPage.vue b/frontend/src/pages/FightPage.vue index f904415..4e2f3e8 100644 --- a/frontend/src/pages/FightPage.vue +++ b/frontend/src/pages/FightPage.vue @@ -636,6 +636,29 @@ function onReplayDone() { } } +const isLoadingNext = ref(false) +async function watchAnotherFight() { + if (isLoadingNext.value) return + isLoadingNext.value = true + try { + const res = await fetch('/api/fights') + if (res.ok) { + const fights = await res.json() + const finished = fights.filter((f: any) => f.status === 'finished' && f.id !== fightId.value) + if (finished.length > 0) { + const pick = finished[Math.floor(Math.random() * finished.length)] + router.push(`/arena/${pick.id}`) + return + } + } + router.push('/arena') + } catch { + router.push('/arena') + } finally { + isLoadingNext.value = false + } +} + function startAutoBattle() { if (!myBotId.value || isHumanFight.value) return autoBattle.value = true @@ -934,6 +957,17 @@ function stopAutoBattle() { +