Welcome to mirror list, hosted at ThFree Co, Russian Federation.

sidebar_subscriptions.vue « subscriptions « components « sidebar « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3ad097138a3147dc38a6a5ad3336b1520be15b6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<script>
import { deprecatedCreateFlash as Flash } from '../../../flash';
import { __ } from '../../../locale';
import Store from '../../stores/sidebar_store';
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>