1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-11-01 07:35:57 +09:00
This commit is contained in:
tamaina 2020-05-31 14:57:22 +09:00
parent d3f5001679
commit 7c38cda8ee

View File

@ -91,19 +91,21 @@ export default Vue.extend({
followRequestDone: false,
groupInviteDone: false,
connection: null,
readObserver: new IntersectionObserver((entries, observer) => {
if (!entries.some(entry => entry.isIntersecting)) return;
this.$root.stream.send('readNotification', {
id: this.notification.id
});
entries.map(({ target }) => observer.unobserve(target));
}),
readObserver: null,
faIdCardAlt, faPlus, faQuoteLeft, faQuoteRight, faRetweet, faReply, faAt, faClock, faCheck, faPollH
};
},
mounted() {
if (!this.notification.isRead) {
if (!this.notification.isRead ) {
this.readObserver = new IntersectionObserver((entries, observer) => {
if (!entries.some(entry => entry.isIntersecting)) return;
this.$root.stream.send('readNotification', {
id: this.notification.id
});
entries.map(({ target }) => observer.unobserve(target));
})
this.readObserver.observe(this.$el);
this.connection = this.$root.stream.useSharedConnection('main');