|
@@ -48,11 +48,16 @@ export default {
|
|
|
is_enabled: false,
|
|
is_enabled: false,
|
|
|
loading: false,
|
|
loading: false,
|
|
|
showLoginDialog: false,
|
|
showLoginDialog: false,
|
|
|
- isUserLogin: false,
|
|
|
|
|
pendingToggleValue: null
|
|
pendingToggleValue: null
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
|
|
+ user () {
|
|
|
|
|
+ return this.$store.getters['Auth/user']
|
|
|
|
|
+ },
|
|
|
|
|
+ isUserLogin() {
|
|
|
|
|
+ return this.$store.getters['Auth/isUserLogin']
|
|
|
|
|
+ },
|
|
|
sourceType() {
|
|
sourceType() {
|
|
|
return this.localOptions.sourceType
|
|
return this.localOptions.sourceType
|
|
|
},
|
|
},
|
|
@@ -63,23 +68,18 @@ export default {
|
|
|
watch: {
|
|
watch: {
|
|
|
showLoginDialog (oldVal, newVal) {
|
|
showLoginDialog (oldVal, newVal) {
|
|
|
if (oldVal === true && newVal === false && !this.isUserLogin) {
|
|
if (oldVal === true && newVal === false && !this.isUserLogin) {
|
|
|
- // یعنی کاربر دیالوگ رو بست (نه لاگین کرد)
|
|
|
|
|
|
|
+ // یعنی کاربر دیالوگ رو بست (لاگین نکرد)
|
|
|
this.is_enabled = false
|
|
this.is_enabled = false
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted () {
|
|
mounted () {
|
|
|
- this.loadAuthData()
|
|
|
|
|
if (this.isUserLogin) {
|
|
if (this.isUserLogin) {
|
|
|
this.fetchNotificationStatus()
|
|
this.fetchNotificationStatus()
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
- loadAuthData () { // prevent Hydration node mismatch
|
|
|
|
|
- this.user = this.$store.getters['Auth/user']
|
|
|
|
|
- this.isUserLogin = this.$store.getters['Auth/isUserLogin']
|
|
|
|
|
- },
|
|
|
|
|
fetchNotificationStatus () {
|
|
fetchNotificationStatus () {
|
|
|
this.loading = true
|
|
this.loading = true
|
|
|
APIGateway.alert.getMyCorrespondingAlert(
|
|
APIGateway.alert.getMyCorrespondingAlert(
|