Skip to content

Commit

Permalink
[FIX] Room header not updating when room type changes (#4330)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnlsilva authored Jul 6, 2022
1 parent e399190 commit cc6a403
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions app/views/RoomView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ const roomAttrsUpdate = [
'teamId',
'status',
'lastMessage',
'onHold'
'onHold',
't'
] as TRoomUpdate[];

interface IRoomViewProps extends IBaseScreen<ChatsStackParamList, 'RoomView'> {
Expand Down Expand Up @@ -392,12 +393,6 @@ class RoomView extends React.Component<IRoomViewProps, IRoomViewState> {
this.list.current?.query();
}
}
// If it's not direct message
if (this.t !== 'd') {
if (roomUpdate.topic !== prevState.roomUpdate.topic) {
this.setHeader();
}
}
// If it's a livechat room
if (this.t === 'l') {
if (
Expand All @@ -409,18 +404,7 @@ class RoomView extends React.Component<IRoomViewProps, IRoomViewState> {
this.updateOmnichannel();
}
}
if (roomUpdate.teamMain !== prevState.roomUpdate.teamMain || roomUpdate.teamId !== prevState.roomUpdate.teamId) {
this.setHeader();
}
if (
(roomUpdate.fname !== prevState.roomUpdate.fname ||
roomUpdate.name !== prevState.roomUpdate.name ||
roomUpdate.teamMain !== prevState.roomUpdate.teamMain ||
roomUpdate.teamId !== prevState.roomUpdate.teamId) &&
!this.tmid
) {
this.setHeader();
}
if (roomAttrsUpdate.some(key => !dequal(prevState.roomUpdate[key], roomUpdate[key]))) this.setHeader();
if (insets.left !== prevProps.insets.left || insets.right !== prevProps.insets.right) {
this.setHeader();
}
Expand Down

0 comments on commit cc6a403

Please sign in to comment.