summaryrefslogtreecommitdiff
path: root/src/client/components/note.vue
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2020-02-06 22:18:23 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2020-02-06 22:18:23 +0900
commitff7ae427fd49beaf57bc196ccd8b6bd3fa054e33 (patch)
treecb93e5a5d706c3c56ea51e2f492a4a052d676b11 /src/client/components/note.vue
parentUpdate CHANGELOG.md (diff)
downloadsharkey-ff7ae427fd49beaf57bc196ccd8b6bd3fa054e33.tar.gz
sharkey-ff7ae427fd49beaf57bc196ccd8b6bd3fa054e33.tar.bz2
sharkey-ff7ae427fd49beaf57bc196ccd8b6bd3fa054e33.zip
Resolve #5860
Diffstat (limited to 'src/client/components/note.vue')
-rw-r--r--src/client/components/note.vue10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/client/components/note.vue b/src/client/components/note.vue
index 7600a40582..ebec56560a 100644
--- a/src/client/components/note.vue
+++ b/src/client/components/note.vue
@@ -275,8 +275,14 @@ export default Vue.extend({
methods: {
capture(withHandler = false) {
if (this.$store.getters.isSignedIn) {
- this.connection.send('sn', { id: this.appearNote.id });
- if (withHandler) this.connection.on('noteUpdated', this.onStreamNoteUpdated);
+ if (document.body.contains(this.$el)) {
+ this.connection.send('sn', { id: this.appearNote.id });
+ if (withHandler) this.connection.on('noteUpdated', this.onStreamNoteUpdated);
+ } else {
+ this.$once('hook:activated', () => {
+ this.capture(withHandler);
+ });
+ }
}
},