From 05c7cacdd1ddc3684f0375686d99b5e4043908cd Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 24 May 2020 18:41:40 +0900 Subject: [PATCH] Resolve https://github.com/syuilo/misskey/pull/6406#issuecomment-633203670 --- src/client/components/notifications.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/client/components/notifications.vue b/src/client/components/notifications.vue index 3ed198a04..434a87eb4 100644 --- a/src/client/components/notifications.vue +++ b/src/client/components/notifications.vue @@ -71,10 +71,11 @@ export default Vue.extend({ methods: { onNotification(notification) { - // TODO: ユーザーが画面を見てないと思われるとき(ブラウザやタブがアクティブじゃないなど)は送信しない - this.$root.stream.send('readNotification', { - id: notification.id - }); + if (document.visibilityState === 'visible') { + this.$root.stream.send('readNotification', { + id: notification.id + }); + } this.prepend(notification); },