diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-10-07 11:06:17 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-07 11:06:17 +0900 |
| commit | d0570d7fe3a3bf3c6b0312dece74bacc04c3534a (patch) | |
| tree | 698218279a38f9c78b0350e81b8ac77ae52e4a0d /src/client/app/mobile/views/components/ui.header.vue | |
| parent | Fix お知らせが確認中...のままになる(Announcement Fetching...) (... (diff) | |
| download | misskey-d0570d7fe3a3bf3c6b0312dece74bacc04c3534a.tar.gz misskey-d0570d7fe3a3bf3c6b0312dece74bacc04c3534a.tar.bz2 misskey-d0570d7fe3a3bf3c6b0312dece74bacc04c3534a.zip | |
V10 (#2826)
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* Update CHANGELOG.md
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* Update CHANGELOG.md
* Update CHANGELOG.md
* wip
* Update CHANGELOG.md
* wip
* wip
* wip
* wip
Diffstat (limited to 'src/client/app/mobile/views/components/ui.header.vue')
| -rw-r--r-- | src/client/app/mobile/views/components/ui.header.vue | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/client/app/mobile/views/components/ui.header.vue b/src/client/app/mobile/views/components/ui.header.vue index 7fd68002e7..9793d03a8c 100644 --- a/src/client/app/mobile/views/components/ui.header.vue +++ b/src/client/app/mobile/views/components/ui.header.vue @@ -24,44 +24,47 @@ import { env } from '../../../config'; export default Vue.extend({ props: ['func'], + data() { return { hasGameInvitation: false, connection: null, - connectionId: null, env: env }; }, + computed: { hasUnreadNotification(): boolean { return this.$store.getters.isSignedIn && this.$store.state.i.hasUnreadNotification; }, + hasUnreadMessagingMessage(): boolean { return this.$store.getters.isSignedIn && this.$store.state.i.hasUnreadMessagingMessage; } }, + mounted() { this.$store.commit('setUiHeaderHeight', this.$refs.root.offsetHeight); if (this.$store.getters.isSignedIn) { - this.connection = (this as any).os.stream.getConnection(); - this.connectionId = (this as any).os.stream.use(); + this.connection = (this as any).os.stream.useSharedConnection('main'); - this.connection.on('reversi_invited', this.onReversiInvited); + this.connection.on('reversiInvited', this.onReversiInvited); this.connection.on('reversi_no_invites', this.onReversiNoInvites); } }, + beforeDestroy() { if (this.$store.getters.isSignedIn) { - this.connection.off('reversi_invited', this.onReversiInvited); - this.connection.off('reversi_no_invites', this.onReversiNoInvites); - (this as any).os.stream.dispose(this.connectionId); + this.connection.dispose(); } }, + methods: { onReversiInvited() { this.hasGameInvitation = true; }, + onReversiNoInvites() { this.hasGameInvitation = false; } |