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); },