[FIX] Room header not updating when room type changes (#4330)
This commit is contained in:
parent
e39919094e
commit
cc6a403bf7
|
@ -146,7 +146,8 @@ const roomAttrsUpdate = [
|
||||||
'teamId',
|
'teamId',
|
||||||
'status',
|
'status',
|
||||||
'lastMessage',
|
'lastMessage',
|
||||||
'onHold'
|
'onHold',
|
||||||
|
't'
|
||||||
] as TRoomUpdate[];
|
] as TRoomUpdate[];
|
||||||
|
|
||||||
interface IRoomViewProps extends IBaseScreen<ChatsStackParamList, 'RoomView'> {
|
interface IRoomViewProps extends IBaseScreen<ChatsStackParamList, 'RoomView'> {
|
||||||
|
@ -392,12 +393,6 @@ class RoomView extends React.Component<IRoomViewProps, IRoomViewState> {
|
||||||
this.list.current?.query();
|
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 it's a livechat room
|
||||||
if (this.t === 'l') {
|
if (this.t === 'l') {
|
||||||
if (
|
if (
|
||||||
|
@ -409,18 +404,7 @@ class RoomView extends React.Component<IRoomViewProps, IRoomViewState> {
|
||||||
this.updateOmnichannel();
|
this.updateOmnichannel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (roomUpdate.teamMain !== prevState.roomUpdate.teamMain || roomUpdate.teamId !== prevState.roomUpdate.teamId) {
|
if (roomAttrsUpdate.some(key => !dequal(prevState.roomUpdate[key], roomUpdate[key]))) this.setHeader();
|
||||||
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 (insets.left !== prevProps.insets.left || insets.right !== prevProps.insets.right) {
|
if (insets.left !== prevProps.insets.left || insets.right !== prevProps.insets.right) {
|
||||||
this.setHeader();
|
this.setHeader();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue