From 6177ffc24274634c22a8d8a8711128721c820c3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Sun, 8 Nov 2020 22:50:18 +0100 Subject: [PATCH] member is_admin. --- src/app.vue | 2 +- src/internal/messages.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app.vue b/src/app.vue index 00754c3d..f290dc32 100644 --- a/src/app.vue +++ b/src/app.vue @@ -95,7 +95,7 @@ member.name {{ neko.state.member.name }} - + member.is_admin {{ neko.state.member.is_admin }} diff --git a/src/internal/messages.ts b/src/internal/messages.ts index 3f4cce5a..ee56ad61 100644 --- a/src/internal/messages.ts +++ b/src/internal/messages.ts @@ -81,6 +81,10 @@ export class NekoMessages extends EventEmitter { console.log('EVENT.MEMBER.CONNECTED') this.emit('member.connected', member.id) //user.addMember(member) + + if (member.id === this.state.member.id) { + Vue.set(this.state.member, 'is_admin', member.admin) + } } protected [EVENT.MEMBER.DISCONNECTED]({ id }: MemberDisconnectPayload) {