1
0
This commit is contained in:
syuilo
2018-02-18 12:35:18 +09:00
parent 61b95e0c26
commit 99b3499364
103 changed files with 878 additions and 790 deletions
+4 -4
View File
@@ -23,8 +23,8 @@ export default Vue.extend({
document.title = 'Misskey';
document.documentElement.style.background = '#313a42';
this.connection = this.$root.$data.os.stream.getConnection();
this.connectionId = this.$root.$data.os.stream.use();
this.connection = (this as any).os.stream.getConnection();
this.connectionId = (this as any).os.stream.use();
this.connection.on('post', this.onStreamPost);
document.addEventListener('visibilitychange', this.onVisibilitychange, false);
@@ -33,7 +33,7 @@ export default Vue.extend({
},
beforeDestroy() {
this.connection.off('post', this.onStreamPost);
this.$root.$data.os.stream.dispose(this.connectionId);
(this as any).os.stream.dispose(this.connectionId);
document.removeEventListener('visibilitychange', this.onVisibilitychange);
},
methods: {
@@ -44,7 +44,7 @@ export default Vue.extend({
Progress.done();
},
onStreamPost(post) {
if (document.hidden && post.user_id !== this.$root.$data.os.i.id) {
if (document.hidden && post.user_id !== (this as any).os.i.id) {
this.unreadCount++;
document.title = `(${this.unreadCount}) ${getPostSummary(post)}`;
}