お知らせメールを受け取るかどうかの設定を追加
This commit is contained in:
parent
4ecd036d0a
commit
547da89c7d
6 changed files with 37 additions and 1 deletions
|
@ -8,6 +8,10 @@
|
|||
{{ $i.email || $ts.notSet }}
|
||||
</FormLink>
|
||||
</FormGroup>
|
||||
|
||||
<FormSwitch :value="$i.receiveAnnouncementEmail" @update:value="onChangeReceiveAnnouncementEmail">
|
||||
{{ $ts.receiveAnnouncementFromInstance }}
|
||||
</FormSwitch>
|
||||
</FormBase>
|
||||
</template>
|
||||
|
||||
|
@ -19,6 +23,7 @@ import FormButton from '@/components/form/button.vue';
|
|||
import FormLink from '@/components/form/link.vue';
|
||||
import FormBase from '@/components/form/base.vue';
|
||||
import FormGroup from '@/components/form/group.vue';
|
||||
import FormSwitch from '@/components/form/switch.vue';
|
||||
import * as os from '@/os';
|
||||
|
||||
export default defineComponent({
|
||||
|
@ -26,6 +31,7 @@ export default defineComponent({
|
|||
FormBase,
|
||||
FormLink,
|
||||
FormButton,
|
||||
FormSwitch,
|
||||
FormGroup,
|
||||
},
|
||||
|
||||
|
@ -46,7 +52,11 @@ export default defineComponent({
|
|||
},
|
||||
|
||||
methods: {
|
||||
|
||||
onChangeReceiveAnnouncementEmail(v) {
|
||||
os.api('i/update', {
|
||||
receiveAnnouncementEmail: v
|
||||
});
|
||||
},
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -133,6 +133,11 @@ export class UserProfile {
|
|||
})
|
||||
public injectFeaturedNote: boolean;
|
||||
|
||||
@Column('boolean', {
|
||||
default: true,
|
||||
})
|
||||
public receiveAnnouncementEmail: boolean;
|
||||
|
||||
@Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
|
|
|
@ -236,6 +236,7 @@ export class UserRepository extends Repository<User> {
|
|||
avatarId: user.avatarId,
|
||||
bannerId: user.bannerId,
|
||||
injectFeaturedNote: profile!.injectFeaturedNote,
|
||||
receiveAnnouncementEmail: profile!.receiveAnnouncementEmail,
|
||||
alwaysMarkNsfw: profile!.alwaysMarkNsfw,
|
||||
carefulBot: profile!.carefulBot,
|
||||
autoAcceptFollowed: profile!.autoAcceptFollowed,
|
||||
|
|
|
@ -135,6 +135,10 @@ export const meta = {
|
|||
validator: $.optional.bool,
|
||||
},
|
||||
|
||||
receiveAnnouncementEmail: {
|
||||
validator: $.optional.bool,
|
||||
},
|
||||
|
||||
alwaysMarkNsfw: {
|
||||
validator: $.optional.bool,
|
||||
desc: {
|
||||
|
@ -219,6 +223,7 @@ export default define(meta, async (ps, user, token) => {
|
|||
if (typeof ps.noCrawle === 'boolean') profileUpdates.noCrawle = ps.noCrawle;
|
||||
if (typeof ps.isCat === 'boolean') updates.isCat = ps.isCat;
|
||||
if (typeof ps.injectFeaturedNote === 'boolean') profileUpdates.injectFeaturedNote = ps.injectFeaturedNote;
|
||||
if (typeof ps.receiveAnnouncementEmail === 'boolean') profileUpdates.receiveAnnouncementEmail = ps.receiveAnnouncementEmail;
|
||||
if (typeof ps.alwaysMarkNsfw === 'boolean') profileUpdates.alwaysMarkNsfw = ps.alwaysMarkNsfw;
|
||||
|
||||
if (ps.avatarId) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue