summaryrefslogtreecommitdiff
path: root/src/client/app
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-05-27 00:27:46 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-05-27 00:27:46 +0900
commite7d1b6ec00e75c29c89bf5cf555b5b50812ee7e6 (patch)
tree104799b6f82584ae06d85fb8c87829e59298e93e /src/client/app
parent#1539 (diff)
downloadmisskey-e7d1b6ec00e75c29c89bf5cf555b5b50812ee7e6.tar.gz
misskey-e7d1b6ec00e75c29c89bf5cf555b5b50812ee7e6.tar.bz2
misskey-e7d1b6ec00e75c29c89bf5cf555b5b50812ee7e6.zip
Fix bug
Diffstat (limited to 'src/client/app')
-rw-r--r--src/client/app/desktop/views/components/timeline.core.vue15
-rw-r--r--src/client/app/desktop/views/pages/home.vue33
2 files changed, 0 insertions, 48 deletions
diff --git a/src/client/app/desktop/views/components/timeline.core.vue b/src/client/app/desktop/views/components/timeline.core.vue
index 3c7e87aea1..3fcec86e48 100644
--- a/src/client/app/desktop/views/components/timeline.core.vue
+++ b/src/client/app/desktop/views/components/timeline.core.vue
@@ -34,7 +34,6 @@ export default Vue.extend({
existMore: false,
connection: null,
connectionId: null,
- unreadCount: 0,
date: null
};
},
@@ -76,7 +75,6 @@ export default Vue.extend({
}
document.addEventListener('keydown', this.onKeydown);
- document.addEventListener('visibilitychange', this.onVisibilitychange, false);
this.fetch();
},
@@ -90,7 +88,6 @@ export default Vue.extend({
this.stream.dispose(this.connectionId);
document.removeEventListener('keydown', this.onKeydown);
- document.removeEventListener('visibilitychange', this.onVisibilitychange);
},
methods: {
@@ -141,11 +138,6 @@ export default Vue.extend({
},
onNote(note) {
- if (document.hidden && note.userId !== (this as any).os.i.id) {
- this.unreadCount++;
- document.title = `(${this.unreadCount}) ${getNoteSummary(note)}`;
- }
-
// Prepend a note
(this.$refs.timeline as any).prepend(note);
},
@@ -163,13 +155,6 @@ export default Vue.extend({
this.fetch();
},
- onVisibilitychange() {
- if (!document.hidden) {
- this.unreadCount = 0;
- document.title = 'Misskey';
- }
- },
-
onKeydown(e) {
if (e.target.tagName != 'INPUT' && e.target.tagName != 'TEXTAREA') {
if (e.which == 84) { // t
diff --git a/src/client/app/desktop/views/pages/home.vue b/src/client/app/desktop/views/pages/home.vue
index e4caa2022e..60b257edb7 100644
--- a/src/client/app/desktop/views/pages/home.vue
+++ b/src/client/app/desktop/views/pages/home.vue
@@ -7,7 +7,6 @@
<script lang="ts">
import Vue from 'vue';
import Progress from '../../../common/scripts/loading';
-import getNoteSummary from '../../../../../renderers/get-note-summary';
export default Vue.extend({
props: {
@@ -16,46 +15,14 @@ export default Vue.extend({
default: 'timeline'
}
},
- data() {
- return {
- connection: null,
- connectionId: null,
- unreadCount: 0
- };
- },
mounted() {
document.title = 'Misskey';
- this.connection = (this as any).os.stream.getConnection();
- this.connectionId = (this as any).os.stream.use();
-
- this.connection.on('note', this.onStreamNote);
- document.addEventListener('visibilitychange', this.onVisibilitychange, false);
-
Progress.start();
},
- beforeDestroy() {
- this.connection.off('note', this.onStreamNote);
- (this as any).os.stream.dispose(this.connectionId);
- document.removeEventListener('visibilitychange', this.onVisibilitychange);
- },
methods: {
loaded() {
Progress.done();
- },
-
- onStreamNote(note) {
- if (document.hidden && note.userId != (this as any).os.i.id) {
- this.unreadCount++;
- document.title = `(${this.unreadCount}) ${getNoteSummary(note)}`;
- }
- },
-
- onVisibilitychange() {
- if (!document.hidden) {
- this.unreadCount = 0;
- document.title = 'Misskey';
- }
}
}
});