|
|
@@ -5,7 +5,7 @@
|
|
|
checked-icon="notifications"
|
|
|
unchecked-icon="notifications_off"
|
|
|
color="primary"
|
|
|
- :label="`اطلاعرسانی درس سطح یک`"
|
|
|
+ :label="localOptions.sourceTitle"
|
|
|
left-label
|
|
|
:disable="loading"
|
|
|
@update:model-value="onToggle">
|
|
|
@@ -29,11 +29,13 @@
|
|
|
|
|
|
<script>
|
|
|
import LoginComponent from 'src/components/Auth/LoginComponent.vue'
|
|
|
+import { mixinWidget } from 'src/mixin/Mixins.js'
|
|
|
import { APIGateway } from 'src/api/APIGateway'
|
|
|
|
|
|
export default {
|
|
|
name: 'NotificationToggle',
|
|
|
components: { LoginComponent },
|
|
|
+ mixins: [mixinWidget],
|
|
|
props: {
|
|
|
initialState: {
|
|
|
type: Boolean,
|
|
|
@@ -42,8 +44,6 @@ export default {
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
- sourceType: 'UNIT',
|
|
|
- sourceId: 1,
|
|
|
// is_enabled: this.initialState,
|
|
|
is_enabled: false,
|
|
|
loading: false,
|
|
|
@@ -51,12 +51,21 @@ export default {
|
|
|
isUserLogin: false
|
|
|
}
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ sourceType() {
|
|
|
+ return this.localOptions.sourceType
|
|
|
+ },
|
|
|
+ sourceId() {
|
|
|
+ return this.localOptions.sourceId
|
|
|
+ }
|
|
|
+ },
|
|
|
mounted () {
|
|
|
this.loadAuthData()
|
|
|
if (this.isUserLogin) {
|
|
|
this.fetchNotificationStatus()
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
methods: {
|
|
|
loadAuthData () { // prevent Hydration node mismatch
|
|
|
this.user = this.$store.getters['Auth/user']
|