fix: general routing not wokring; fix: settings tab not showing up

This commit is contained in:
Roberto Tonino
2020-08-22 23:34:16 +02:00
parent a53204668b
commit 972d1fe680
10 changed files with 109 additions and 63 deletions

View File

@@ -20,6 +20,7 @@ Vue.use(VueRouter)
const routes = [
{
path: '/',
name: 'Home',
component: TheHomeTab
},
{
@@ -70,7 +71,7 @@ const routes = [
// 404 client side
{
path: '*',
component: TracklistTab
component: TheHomeTab
}
]
@@ -85,25 +86,36 @@ const router = new VueRouter({
router.beforeEach((to, from, next) => {
console.log('before route change', to)
let getTracklistParams = null
switch (to.name) {
case 'Artist':
socket.emit('getTracklist', {
getTracklistParams = {
type: 'artist',
id: to.params.id
})
}
break
case 'Tracklist':
socket.emit('getTracklist', {
getTracklistParams = {
type: to.params.type,
id: to.params.id
})
}
break
case 'Home':
socket.emit('get_home_data')
break
case 'Charts':
socket.emit('get_charts_data')
break
default:
break
}
if (getTracklistParams) {
socket.emit('getTracklist', getTracklistParams)
}
EventBus.$emit('trackPreview:stopStackedTabsPreview')
next()