summaryrefslogtreecommitdiff
path: root/src/client/app/common
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-08-03 22:34:58 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-08-03 22:34:58 +0900
commitcbcf3fd7f1dd8a8a6f92d598712c0f6d97e227f9 (patch)
tree5bf5caee275537dd8253dcce07b2267a5c0ed55f /src/client/app/common
parentMerge pull request #2068 from syuilo/greenkeeper/webpack-4.16.4 (diff)
downloadmisskey-cbcf3fd7f1dd8a8a6f92d598712c0f6d97e227f9.tar.gz
misskey-cbcf3fd7f1dd8a8a6f92d598712c0f6d97e227f9.tar.bz2
misskey-cbcf3fd7f1dd8a8a6f92d598712c0f6d97e227f9.zip
:v:
Diffstat (limited to 'src/client/app/common')
-rw-r--r--src/client/app/common/views/components/games/reversi/reversi.vue33
1 files changed, 22 insertions, 11 deletions
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 4169a5465a..60d46307e8 100644
--- a/src/client/app/common/views/components/games/reversi/reversi.vue
+++ b/src/client/app/common/views/components/games/reversi/reversi.vue
@@ -10,7 +10,7 @@
</div>
</div>
<div class="index" v-else>
- <x-index @go="onGo" @matching="onMatching"/>
+ <x-index @go="nav" @matching="onMatching"/>
</div>
</div>
</template>
@@ -19,6 +19,7 @@
import Vue from 'vue';
import XGameroom from './reversi.gameroom.vue';
import XIndex from './reversi.index.vue';
+import Progress from '../../../../scripts/loading';
export default Vue.extend({
components: {
@@ -26,7 +27,12 @@ export default Vue.extend({
XIndex
},
- props: ['initGame'],
+ props: {
+ gameId: {
+ type: String,
+ required: false
+ }
+ },
data() {
return {
@@ -39,14 +45,15 @@ export default Vue.extend({
},
watch: {
- game(g) {
- this.$emit('gamed', g);
- }
- },
-
- created() {
- if (this.initGame) {
- this.game = this.initGame;
+ gameId(id) {
+ console.log(id);
+ Progress.start();
+ (this as any).api('games/reversi/games/show', {
+ gameId: id
+ }).then(game => {
+ this.nav(game, true);
+ Progress.done();
+ });
}
},
@@ -78,9 +85,13 @@ export default Vue.extend({
},
methods: {
- onGo(game) {
+ nav(game, silent) {
this.matching = null;
this.game = game;
+
+ if (!silent) {
+ this.$emit('nav', this.game);
+ }
},
onMatching(user) {