mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-12-12 21:58:11 +09:00
Fix bug
This commit is contained in:
parent
b8a16af90c
commit
a297c9f03c
@ -9,6 +9,9 @@
|
|||||||
<form-button round @click="cancel">%i18n:@matching.cancel%</form-button>
|
<form-button round @click="cancel">%i18n:@matching.cancel%</form-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="gameId">
|
||||||
|
...
|
||||||
|
</div>
|
||||||
<div class="index" v-else>
|
<div class="index" v-else>
|
||||||
<x-index @go="nav" @matching="onMatching"/>
|
<x-index @go="nav" @matching="onMatching"/>
|
||||||
</div>
|
</div>
|
||||||
@ -45,22 +48,14 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
gameId(id) {
|
gameId() {
|
||||||
if (id == null) {
|
this.fetch();
|
||||||
this.game = null;
|
|
||||||
} else {
|
|
||||||
Progress.start();
|
|
||||||
(this as any).api('games/reversi/games/show', {
|
|
||||||
gameId: id
|
|
||||||
}).then(game => {
|
|
||||||
this.nav(game, true);
|
|
||||||
Progress.done();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.fetch();
|
||||||
|
|
||||||
if (this.$store.getters.isSignedIn) {
|
if (this.$store.getters.isSignedIn) {
|
||||||
this.connection = (this as any).os.streams.reversiStream.getConnection();
|
this.connection = (this as any).os.streams.reversiStream.getConnection();
|
||||||
this.connectionId = (this as any).os.streams.reversiStream.use();
|
this.connectionId = (this as any).os.streams.reversiStream.use();
|
||||||
@ -88,6 +83,20 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
fetch() {
|
||||||
|
if (this.gameId == null) {
|
||||||
|
this.game = null;
|
||||||
|
} else {
|
||||||
|
Progress.start();
|
||||||
|
(this as any).api('games/reversi/games/show', {
|
||||||
|
gameId: this.gameId
|
||||||
|
}).then(game => {
|
||||||
|
this.nav(game, true);
|
||||||
|
Progress.done();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
nav(game, silent) {
|
nav(game, silent) {
|
||||||
this.matching = null;
|
this.matching = null;
|
||||||
this.game = game;
|
this.game = game;
|
||||||
|
Loading…
Reference in New Issue
Block a user