2021-02-13 04:28:26 +01:00
|
|
|
<template>
|
|
|
|
<FormBase>
|
|
|
|
<FormGroup>
|
|
|
|
<FormSwitch v-model:value="mention">
|
|
|
|
{{ $ts._notification._types.mention }}
|
|
|
|
</FormSwitch>
|
|
|
|
<FormSwitch v-model:value="reply">
|
|
|
|
{{ $ts._notification._types.reply }}
|
|
|
|
</FormSwitch>
|
|
|
|
<FormSwitch v-model:value="quote">
|
|
|
|
{{ $ts._notification._types.quote }}
|
|
|
|
</FormSwitch>
|
|
|
|
<FormSwitch v-model:value="follow">
|
|
|
|
{{ $ts._notification._types.follow }}
|
|
|
|
</FormSwitch>
|
|
|
|
<FormSwitch v-model:value="receiveFollowRequest">
|
|
|
|
{{ $ts._notification._types.receiveFollowRequest }}
|
|
|
|
</FormSwitch>
|
|
|
|
<FormSwitch v-model:value="groupInvited">
|
|
|
|
{{ $ts._notification._types.groupInvited }}
|
|
|
|
</FormSwitch>
|
|
|
|
</FormGroup>
|
|
|
|
</FormBase>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent } from 'vue';
|
2021-03-23 09:30:14 +01:00
|
|
|
import FormButton from '@client/components/form/button.vue';
|
|
|
|
import FormSwitch from '@client/components/form/switch.vue';
|
|
|
|
import FormBase from '@client/components/form/base.vue';
|
|
|
|
import FormGroup from '@client/components/form/group.vue';
|
|
|
|
import * as os from '@client/os';
|
2021-04-10 05:54:12 +02:00
|
|
|
import * as symbols from '@client/symbols';
|
|
|
|
import * as symbols from '@client/symbols';
|
2021-02-13 04:28:26 +01:00
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
|
|
|
FormBase,
|
|
|
|
FormSwitch,
|
|
|
|
FormButton,
|
|
|
|
FormGroup,
|
|
|
|
},
|
|
|
|
|
|
|
|
emits: ['info'],
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
2021-04-10 05:54:12 +02:00
|
|
|
[symbols.PAGE_INFO]: {
|
2021-02-13 04:28:26 +01:00
|
|
|
title: this.$ts.emailNotification,
|
2021-04-20 16:22:59 +02:00
|
|
|
icon: 'fas fa-envelope'
|
2021-02-13 04:28:26 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
mention: this.$i.emailNotificationTypes.includes('mention'),
|
|
|
|
reply: this.$i.emailNotificationTypes.includes('reply'),
|
|
|
|
quote: this.$i.emailNotificationTypes.includes('quote'),
|
|
|
|
follow: this.$i.emailNotificationTypes.includes('follow'),
|
|
|
|
receiveFollowRequest: this.$i.emailNotificationTypes.includes('receiveFollowRequest'),
|
|
|
|
groupInvited: this.$i.emailNotificationTypes.includes('groupInvited'),
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
created() {
|
|
|
|
this.$watch('mention', this.save);
|
|
|
|
this.$watch('reply', this.save);
|
|
|
|
this.$watch('quote', this.save);
|
|
|
|
this.$watch('follow', this.save);
|
|
|
|
this.$watch('receiveFollowRequest', this.save);
|
|
|
|
this.$watch('groupInvited', this.save);
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
2021-04-10 05:54:12 +02:00
|
|
|
this.$emit('info', this[symbols.PAGE_INFO]);
|
2021-02-13 04:28:26 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
save() {
|
|
|
|
os.api('i/update', {
|
|
|
|
emailNotificationTypes: [
|
|
|
|
...[this.mention ? 'mention' : null],
|
|
|
|
...[this.reply ? 'reply' : null],
|
|
|
|
...[this.quote ? 'quote' : null],
|
|
|
|
...[this.follow ? 'follow' : null],
|
|
|
|
...[this.receiveFollowRequest ? 'receiveFollowRequest' : null],
|
|
|
|
...[this.groupInvited ? 'groupInvited' : null],
|
|
|
|
].filter(x => x != null)
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|