diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue
index a7bd698..853cdfc 100644
--- a/src/components/Navbar.vue
+++ b/src/components/Navbar.vue
@@ -1,106 +1,108 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Quiz.vue b/src/components/Quiz.vue
index d802766..6429f43 100644
--- a/src/components/Quiz.vue
+++ b/src/components/Quiz.vue
@@ -262,13 +262,13 @@ export default {
:
await this.getQuestionsFromAPIForNewQuiz()
- this.mode.gameMode !== "zen" && await this.createQuizAndMatchOnDB()
+ useSessionStore().user.isConnected && this.mode.gameMode !== "zen" && await this.createQuizAndMatchOnDB()
},
watch: {
counter(value) {
// when matches finish and game mode is not zen
- if (value>this.questions.length-1 && this.mode.gameMode !== "zen") this.handleFinishedQuiz()
+ if (useSessionStore().user.isConnected && value>this.questions.length-1 && this.mode.gameMode !== "zen") this.handleFinishedQuiz()
},
}
@@ -277,11 +277,7 @@ export default {
-
-
+
{{questions[counter].option_c}}
+
-
-import BigButtonsMenu from '@/components/BigButtonsMenu.vue'
-import router from '@/router/router.js'
-import { useSessionStore } from '@/stores/sessionStore.js'
-import { v4 as uuidv4 } from 'uuid';
-
-export default {
- name: 'Games',
- components: { BigButtonsMenu },
- data(){
- return{
- roomID: null
- }
- },
-
- methods: {
- router() {
- return router
- },
- generateRoomID(){
- useSessionStore().user.createdRoomID = uuidv4().split('-')[4]
- useSessionStore().user.roomAdmin = true
- this.router().push('/room')
- },
-
- joinToExistingRoom(){
- useSessionStore().user.joinedRoomID = this.roomID
- this.router().push('/room')
- }
- },
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Multiplayer
-
-
-
-
-
Or create new one
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Multiplayer
+
+
+
+
+
Or create new one
+
+
+
+
+
+
+
+
+
diff --git a/src/router/router.js b/src/router/router.js
index ff28bd3..482ce6b 100644
--- a/src/router/router.js
+++ b/src/router/router.js
@@ -1,11 +1,9 @@
import { createRouter, createWebHashHistory } from 'vue-router'
-import NotFound404 from '/src/pages/NotFound404.vue'
import RootLayout from '/src/layouts/RootLayout.vue'
import PrivateLayout from '/src/layouts/PrivateLayout.vue'
import Home from '/src/pages/Home.vue'
import { useSessionStore } from '@/stores/sessionStore.js'
-import Games from '@/pages/Games.vue'
const routes = [
@@ -21,8 +19,8 @@ const routes = [
{ path: "/login", component: ()=> import('/src/pages/Login.vue')},
{ path: "/register", component: ()=> import('/src/pages/Register.vue')},
{ path: "/play", component: ()=> import('/src/pages/Games.vue')},
- { path: "/quick", component: ()=> import('/src/pages/Games.vue')},
- { path: "/zen", component: ()=> import('/src/pages/Games.vue')},
+ { path: "/quick", component: ()=> import('/src/pages/Quick.vue')},
+ { path: "/zen", component: ()=> import('/src/pages/Zen.vue')},
// Private pages
{
@@ -42,7 +40,7 @@ const routes = [
path: "/profile",
component: PrivateLayout,
beforeEnter(to, from, next) {
- useSessionStore().isLogged() ? next() : router.push('/')
+ useSessionStore().isLogged() ? next() : router.push('/login')
},
children: [
{
@@ -69,7 +67,7 @@ const routes = [
path: "/create",
component: PrivateLayout,
beforeEnter(to, from, next) {
- useSessionStore().isLogged() ? next() : router.push('/')
+ useSessionStore().isLogged() ? next() : router.push('/login')
},
children: [
{
@@ -82,7 +80,7 @@ const routes = [
{
path: "/records",
beforeEnter(to, from, next) {
- useSessionStore().isLogged() ? next() : router.push('/')
+ useSessionStore().isLogged() ? next() : router.push('/login')
},
component: PrivateLayout,
children: [
@@ -96,7 +94,7 @@ const routes = [
{
path: "/room",
beforeEnter(to, from, next) {
- useSessionStore().isLogged() ? next() : router.push('/')
+ useSessionStore().isLogged() ? next() : router.push('/login')
},
component: PrivateLayout,
children: [