diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-11-09 08:13:34 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-11-09 08:13:34 +0900 |
| commit | 60ef3e3563c95008bde52818a7d638d1d8ff9b19 (patch) | |
| tree | 085539a945faa4fe4105f82f65e5d320ea542b03 /src/client/app/common/views/components/games | |
| parent | Clean up (diff) | |
| download | misskey-60ef3e3563c95008bde52818a7d638d1d8ff9b19.tar.gz misskey-60ef3e3563c95008bde52818a7d638d1d8ff9b19.tar.bz2 misskey-60ef3e3563c95008bde52818a7d638d1d8ff9b19.zip | |
Refactor & Clean up
Diffstat (limited to 'src/client/app/common/views/components/games')
4 files changed, 14 insertions, 14 deletions
diff --git a/src/client/app/common/views/components/games/reversi/reversi.game.vue b/src/client/app/common/views/components/games/reversi/reversi.game.vue index 08c69f3076..14c0c0891c 100644 --- a/src/client/app/common/views/components/games/reversi/reversi.game.vue +++ b/src/client/app/common/views/components/games/reversi/reversi.game.vue @@ -291,7 +291,7 @@ export default Vue.extend({ }, surrender() { - (this as any).api('games/reversi/games/surrender', { + this.$root.api('games/reversi/games/surrender', { gameId: this.game.id }); }, diff --git a/src/client/app/common/views/components/games/reversi/reversi.gameroom.vue b/src/client/app/common/views/components/games/reversi/reversi.gameroom.vue index 471decc240..4099389502 100644 --- a/src/client/app/common/views/components/games/reversi/reversi.gameroom.vue +++ b/src/client/app/common/views/components/games/reversi/reversi.gameroom.vue @@ -35,7 +35,7 @@ export default Vue.extend({ }, created() { this.g = this.game; - this.connection = (this as any).os.stream.connectToChannel('gamesReversiGame', { + this.connection = this.$root.stream.connectToChannel('gamesReversiGame', { gameId: this.game.id }); this.connection.on('started', this.onStarted); diff --git a/src/client/app/common/views/components/games/reversi/reversi.index.vue b/src/client/app/common/views/components/games/reversi/reversi.index.vue index 5711f0cf2b..eb657365ab 100644 --- a/src/client/app/common/views/components/games/reversi/reversi.index.vue +++ b/src/client/app/common/views/components/games/reversi/reversi.index.vue @@ -67,22 +67,22 @@ export default Vue.extend({ mounted() { if (this.$store.getters.isSignedIn) { - this.connection = (this as any).os.stream.useSharedConnection('gamesReversi'); + this.connection = this.$root.stream.useSharedConnection('gamesReversi'); this.connection.on('invited', this.onInvited); - (this as any).api('games/reversi/games', { + this.$root.api('games/reversi/games', { my: true }).then(games => { this.myGames = games; }); - (this as any).api('games/reversi/invitations').then(invitations => { + this.$root.api('games/reversi/invitations').then(invitations => { this.invitations = this.invitations.concat(invitations); }); } - (this as any).api('games/reversi/games').then(games => { + this.$root.api('games/reversi/games').then(games => { this.games = games; this.gamesFetching = false; }); @@ -103,10 +103,10 @@ export default Vue.extend({ (this as any).apis.input({ title: this.$t('enter-username') }).then(username => { - (this as any).api('users/show', { + this.$root.api('users/show', { username }).then(user => { - (this as any).api('games/reversi/match', { + this.$root.api('games/reversi/match', { userId: user.id }).then(res => { if (res == null) { @@ -120,7 +120,7 @@ export default Vue.extend({ }, accept(invitation) { - (this as any).api('games/reversi/match', { + this.$root.api('games/reversi/match', { userId: invitation.parent.id }).then(game => { if (game) { diff --git a/src/client/app/common/views/components/games/reversi/reversi.vue b/src/client/app/common/views/components/games/reversi/reversi.vue index ab47acbfe3..8c555a6c4f 100644 --- a/src/client/app/common/views/components/games/reversi/reversi.vue +++ b/src/client/app/common/views/components/games/reversi/reversi.vue @@ -67,7 +67,7 @@ export default Vue.extend({ this.fetch(); if (this.$store.getters.isSignedIn) { - this.connection = (this as any).os.stream.useSharedConnection('gamesReversi'); + this.connection = this.$root.stream.useSharedConnection('gamesReversi'); this.connection.on('matched', this.onMatched); @@ -94,7 +94,7 @@ export default Vue.extend({ this.game = null; } else { Progress.start(); - (this as any).api('games/reversi/games/show', { + this.$root.api('games/reversi/games/show', { gameId: this.gameId }).then(game => { this.game = game; @@ -107,7 +107,7 @@ export default Vue.extend({ if (this.selfNav) { // 受け取ったゲーム情報が省略されたものなら完全な情報を取得する if (game != null && (game.settings == null || game.settings.map == null)) { - game = await (this as any).api('games/reversi/games/show', { + game = await this.$root.api('games/reversi/games/show', { gameId: game.id }); } @@ -124,11 +124,11 @@ export default Vue.extend({ cancel() { this.matching = null; - (this as any).api('games/reversi/match/cancel'); + this.$root.api('games/reversi/match/cancel'); }, accept(invitation) { - (this as any).api('games/reversi/match', { + this.$root.api('games/reversi/match', { userId: invitation.parent.id }).then(game => { if (game) { |