mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-01 20:42:50 +08:00
fix: safe router.back() — fallback to home if no history (prevents navigating to external site)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
eb0088d110
commit
7d329a0db1
2 files changed
+17
-2
No files matched your search
@@ -89,7 +89,12 @@ const currentSong = computed(() => store.currentSong);
|
||||
|
||||
function toggleLyrics() {
|
||||
if (route.path === '/lyrics') {
|
||||
router.back();
|
||||
// Go back if there's history, otherwise go home
|
||||
if (window.history.length > 1) {
|
||||
router.back();
|
||||
} else {
|
||||
router.push('/');
|
||||
}
|
||||
} else {
|
||||
router.push('/lyrics');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user