お知らせメールを受け取るかどうかの設定を追加
This commit is contained in:
parent
4ecd036d0a
commit
547da89c7d
|
@ -700,6 +700,7 @@ capacity: "容量"
|
|||
inUse: "使用中"
|
||||
editCode: "コードを編集"
|
||||
apply: "適用"
|
||||
receiveAnnouncementFromInstance: "インスタンスからのお知らせを受け取る"
|
||||
|
||||
_plugin:
|
||||
install: "プラグインのインストール"
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
import {MigrationInterface, QueryRunner} from "typeorm";
|
||||
|
||||
export class announcementEmail1612619156584 implements MigrationInterface {
|
||||
name = 'announcementEmail1612619156584'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "user_profile" ADD "receiveAnnouncementEmail" boolean NOT NULL DEFAULT true`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "receiveAnnouncementEmail"`);
|
||||
}
|
||||
|
||||
}
|
|
@ -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…
Reference in New Issue