1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-20 01:15:29 +02:00

Merge branch 'develop' into vue3

This commit is contained in:
syuilo
2020-09-19 13:57:38 +09:00
13 changed files with 46 additions and 21 deletions

View File

@@ -65,7 +65,13 @@ export default defineComponent({
}
},
created() {
this.hide = this.image.isSensitive && !this.$store.state.device.alwaysShowNsfw;
// Plugin:register_note_view_interruptor を使って書き換えられる可能性があるためwatchする
this.$watch('image', () => {
this.hide = this.image.isSensitive && !this.$store.state.device.alwaysShowNsfw;
}, {
deep: true,
immediate: true,
});
},
methods: {
onClick() {

View File

@@ -59,7 +59,7 @@ export default defineComponent({
computed: {
allIncludeTypes() {
return this.includeTypes ?? this.$store.state.i.includingNotificationTypes;
return this.includeTypes ?? notificationTypes.filter(x => !this.$store.state.i.mutingNotificationTypes.includes(x));
}
},
@@ -67,7 +67,7 @@ export default defineComponent({
includeTypes() {
this.reload();
},
'$store.state.i.includingNotificationTypes'() {
'$store.state.i.mutingNotificationTypes'() {
if (this.includeTypes === null) {
this.reload();
}
@@ -85,8 +85,7 @@ export default defineComponent({
methods: {
onNotification(notification) {
//
const isMuted = !!this.allIncludeTypes && !this.allIncludeTypes.includes(notification.type);
const isMuted = !this.allIncludeTypes.includes(notification.type);
if (isMuted || document.visibilityState === 'visible') {
os.stream.send('readNotification', {
id: notification.id

View File

@@ -156,8 +156,7 @@ export default defineComponent({
},
async onNotification(notification) {
const t = this.$store.state.i.includingNotificationTypes;
if (!!t && !t.includes(notification.type)) {
if (this.$store.state.i.mutingNotificationTypes.includes(notification.type)) {
return;
}

View File

@@ -326,8 +326,7 @@ export default defineComponent({
},
async onNotification(notification) {
const t = this.$store.state.i.includingNotificationTypes;
if (!!t && !t.includes(notification.type)) {
if (this.$store.state.i.mutingNotificationTypes.includes(notification.type)) {
return;
}
if (document.visibilityState === 'visible') {

View File

@@ -58,6 +58,7 @@ import XApi from './api.vue';
import MkButton from '@/components/ui/button.vue';
import MkSwitch from '@/components/ui/switch.vue';
import * as os from '@/os';
import { notificationTypes } from '../../../types';
export default defineComponent({
metaInfo() {
@@ -114,14 +115,15 @@ export default defineComponent({
},
async configure() {
const includingTypes = notificationTypes.filter(x => !this.$store.state.i.mutingNotificationTypes.includes(x));
os.modal(await import('@/components/notification-setting-window.vue'), {
includingTypes: this.$store.state.i.includingNotificationTypes,
includingTypes,
showGlobalToggle: false,
}).$on('ok', async ({ includingTypes: value }: any) => {
await os.api('i/update', {
includingNotificationTypes: value,
mutingNotificationTypes: notificationTypes.filter(x => !value.includes(x)),
}).then(i => {
this.$store.state.i.includingNotificationTypes = i.includingNotificationTypes;
this.$store.state.i.mutingNotificationTypes = i.mutingNotificationTypes;
}).catch(err => {
os.dialog({
type: 'error',