Skip to content
Snippets Groups Projects
Commit 7c38cda8 authored by tamaina's avatar tamaina
Browse files

Refactor

parent d3f50016
No related branches found
No related tags found
No related merge requests found
......@@ -91,21 +91,23 @@ export default Vue.extend({
followRequestDone: false,
groupInviteDone: false,
connection: null,
readObserver: new IntersectionObserver((entries, observer) => {
readObserver: null,
faIdCardAlt, faPlus, faQuoteLeft, faQuoteRight, faRetweet, faReply, faAt, faClock, faCheck, faPollH
};
},
mounted() {
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));
}),
faIdCardAlt, faPlus, faQuoteLeft, faQuoteRight, faRetweet, faReply, faAt, faClock, faCheck, faPollH
};
},
})
mounted() {
if (!this.notification.isRead) {
this.readObserver.observe(this.$el);
this.connection = this.$root.stream.useSharedConnection('main');
this.connection.on('readAllNotifications', () => this.readObserver.unobserve(this.$el));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment