1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-06-05 00:03:58 +02:00

Post --> Note

Closes #1411
This commit is contained in:
syuilo
2018-04-08 02:30:37 +09:00
parent c7106d250c
commit a1b490afa7
167 changed files with 4440 additions and 1762 deletions

View File

@@ -7,7 +7,7 @@
<script lang="ts">
import Vue from 'vue';
import Progress from '../../../common/scripts/loading';
import getPostSummary from '../../../../../renderers/get-post-summary';
import getNoteSummary from '../../../../../renderers/get-note-summary';
export default Vue.extend({
props: {
@@ -29,13 +29,13 @@ export default Vue.extend({
this.connection = (this as any).os.stream.getConnection();
this.connectionId = (this as any).os.stream.use();
this.connection.on('post', this.onStreamPost);
this.connection.on('note', this.onStreamNote);
document.addEventListener('visibilitychange', this.onVisibilitychange, false);
Progress.start();
},
beforeDestroy() {
this.connection.off('post', this.onStreamPost);
this.connection.off('note', this.onStreamNote);
(this as any).os.stream.dispose(this.connectionId);
document.removeEventListener('visibilitychange', this.onVisibilitychange);
},
@@ -44,10 +44,10 @@ export default Vue.extend({
Progress.done();
},
onStreamPost(post) {
if (document.hidden && post.userId != (this as any).os.i.id) {
onStreamNote(note) {
if (document.hidden && note.userId != (this as any).os.i.id) {
this.unreadCount++;
document.title = `(${this.unreadCount}) ${getPostSummary(post)}`;
document.title = `(${this.unreadCount}) ${getNoteSummary(note)}`;
}
},