[Popup]dodawanie nowej karty tylko dla zalogowanego uzytkkownika
This commit is contained in:
parent
1e13abc752
commit
b782f39ed8
@ -7,6 +7,13 @@
|
||||
</v-btn>
|
||||
</v-snackbar>
|
||||
|
||||
<v-snackbar v-model="snackbarLoginRequred" :timeout="4000" top color="primary success-text">
|
||||
<span>Wymagane logowanie!</span>
|
||||
<v-btn flat color="white" @click="snackbar = false">
|
||||
<v-icon>clear</v-icon>
|
||||
</v-btn>
|
||||
</v-snackbar>
|
||||
|
||||
<v-snackbar v-model="snackbarLogout" :timeout="4000" top color="primary success-text">
|
||||
<span>Wylogowano</span>
|
||||
<v-btn flat color="white" @click="snackbarLogout = false">
|
||||
@ -67,7 +74,7 @@
|
||||
<p class="white--text mt-3 subheading">Edżentelmeni</p>
|
||||
</v-flex>
|
||||
<v-flex class="mb-3">
|
||||
<Popup @cardAdded="snackbar = true"/>
|
||||
<Popup @cardAdded="snackbar = true" @LoginRequired="snackbarLoginRequred = true"/>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
@ -96,7 +103,8 @@ export default {
|
||||
snackbar: false,
|
||||
snackbarLogout: false,
|
||||
isLogged: true,
|
||||
snackbarLogin: false
|
||||
snackbarLogin: false,
|
||||
snackbarLoginRequred: false,
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
|
@ -56,6 +56,21 @@ export default {
|
||||
"Blank" :1 ,
|
||||
"texst": "ALA MA KOTA"
|
||||
}*/
|
||||
if (localStorage.getItem('token') === "null"){
|
||||
this.isLogged = true
|
||||
console.log("TUTAJ: ", localStorage.getItem('token') === null)
|
||||
this.$router.push('/')
|
||||
this.$emit('LoginRequired')
|
||||
return
|
||||
}
|
||||
if(localStorage.getItem('token') === null){
|
||||
console.log("TUTAJ: ", localStorage.getItem('token') === null)
|
||||
this.$router.push('/')
|
||||
this.$emit('LoginRequired')
|
||||
return
|
||||
}
|
||||
else{ //Dodawanie tylko dla zalogowanych
|
||||
console.log("DODAWANIE KARTY")
|
||||
|
||||
if (this.$refs.form.validate()){ // valinnaj JS
|
||||
var blank = 0
|
||||
@ -100,6 +115,7 @@ export default {
|
||||
|
||||
} ///dlugi if
|
||||
}
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
formattedDate(){
|
||||
|
Loading…
Reference in New Issue
Block a user