reversi 💮 💯
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user