reversi 💮 💯

This commit is contained in:
syuilo
2018-06-17 08:10:54 +09:00
parent 03f20599ba
commit 1ef66c962a
48 changed files with 197 additions and 197 deletions

View File

@ -45,8 +45,8 @@ export default Vue.extend({
this.connection = (this as any).os.stream.getConnection();
this.connectionId = (this as any).os.stream.use();
this.connection.on('othello_invited', this.onOthelloInvited);
this.connection.on('othello_no_invites', this.onOthelloNoInvites);
this.connection.on('reversi_invited', this.onReversiInvited);
this.connection.on('reversi_no_invites', this.onReversiNoInvites);
const ago = (new Date().getTime() - new Date(this.$store.state.i.lastUsedAt).getTime()) / 1000;
const isHisasiburi = ago >= 3600;
@ -98,16 +98,16 @@ export default Vue.extend({
},
beforeDestroy() {
if (this.$store.getters.isSignedIn) {
this.connection.off('othello_invited', this.onOthelloInvited);
this.connection.off('othello_no_invites', this.onOthelloNoInvites);
this.connection.off('reversi_invited', this.onReversiInvited);
this.connection.off('reversi_no_invites', this.onReversiNoInvites);
(this as any).os.stream.dispose(this.connectionId);
}
},
methods: {
onOthelloInvited() {
onReversiInvited() {
this.hasGameInvitation = true;
},
onOthelloNoInvites() {
onReversiNoInvites() {
this.hasGameInvitation = false;
}
}