diff --git a/src/App.vue b/src/App.vue index dcf3b54..08ab759 100644 --- a/src/App.vue +++ b/src/App.vue @@ -37,8 +37,12 @@ export default { this.$api.getMyInfo().then(({name}) => { this.$store.dispatch('storeUserData', name).then(() => { - this.$router.push({name: "Collections"}).catch(() => {}); - this.$store.dispatch('setAppReady'); + if (this.$route.path === '/login') { + // TODO: ez igy nagyon gagyi solution + this.$router.push({name: "Collections"}).catch(() => { + }); + } + this.$store.dispatch('setAppReady'); }); diff --git a/src/assets/music_placeholder.png b/src/assets/music_placeholder.png new file mode 100644 index 0000000..73ecf84 Binary files /dev/null and b/src/assets/music_placeholder.png differ diff --git a/src/components/CollectionsListElement.vue b/src/components/CollectionsListElement.vue index 6e34046..b442592 100644 --- a/src/components/CollectionsListElement.vue +++ b/src/components/CollectionsListElement.vue @@ -18,7 +18,7 @@ export default { }, methods: { performClick() { - this.$emit('clicked'); + this.$emit('click'); } } } diff --git a/src/router/index.js b/src/router/index.js index 00fa92b..c28e990 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -74,6 +74,11 @@ const router = new VueRouter({ router.beforeEach((to, from, next) => { + if (!store.state.appReady) { + next(); + return; + } + const authorized = store.getters.isLoggedIn; const visitAllowed = to.matched.some(record => record.meta.allowVisit(authorized)) diff --git a/src/views/Collection.vue b/src/views/Collection.vue index 28dc7a5..13acffb 100644 --- a/src/views/Collection.vue +++ b/src/views/Collection.vue @@ -1,10 +1,77 @@ diff --git a/src/views/Collections.vue b/src/views/Collections.vue index 64ed4ec..8ebec6c 100644 --- a/src/views/Collections.vue +++ b/src/views/Collections.vue @@ -27,7 +27,7 @@ export default { }, methods: { openCollection(id) { - console.log(id); + this.$router.push({name: "Collection", params: {id}}) } }, mounted() {