debian-mirror-gitlab/app/assets/javascripts/sidebar/components/subscriptions/sidebar_subscriptions.vue
2019-12-26 22:10:19 +05:30

42 lines
959 B
Vue

<script>
import Store from '../../stores/sidebar_store';
import Flash from '../../../flash';
import { __ } from '../../../locale';
import subscriptions from './subscriptions.vue';
export default {
components: {
subscriptions,
},
props: {
mediator: {
type: Object,
required: true,
},
},
data() {
return {
store: new Store(),
};
},
methods: {
onToggleSubscription() {
this.mediator.toggleSubscription().catch(() => {
Flash(__('Error occurred when toggling the notification subscription'));
});
},
},
};
</script>
<template>
<div class="block subscriptions">
<subscriptions
:loading="store.isFetching.subscriptions"
:project-emails-disabled="store.projectEmailsDisabled"
:subscribe-disabled-description="store.subscribeDisabledDescription"
:subscribed="store.subscribed"
@toggleSubscription="onToggleSubscription"
/>
</div>
</template>