From 5c8652ec16f27e85ff0a5985bfbeda1b736b741f Mon Sep 17 00:00:00 2001 From: IlarionHalushka Date: Thu, 20 Jun 2019 21:33:15 +0300 Subject: [PATCH] [FIX] Broadcast channel is not readonly (#996) --- app/views/RoomView/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/RoomView/index.js b/app/views/RoomView/index.js index 3ed9a8e3..6ed1b044 100644 --- a/app/views/RoomView/index.js +++ b/app/views/RoomView/index.js @@ -450,7 +450,7 @@ export default class RoomView extends React.Component { isOwner = () => { const { room } = this.state; - return room && room.roles && Array.from(Object.keys(room.roles), i => room.roles[i].value).includes('owner'); + return room && room.roles && room.roles.length && !!room.roles.find(role => role === 'owner'); } isMuted = () => { @@ -461,7 +461,10 @@ export default class RoomView extends React.Component { isReadOnly = () => { const { room } = this.state; - return (room.ro && !room.broadcast) || this.isMuted() || room.archived; + if (this.isOwner()) { + return false; + } + return (room && room.ro) || this.isMuted(); } isBlocked = () => {