This commit is contained in:
leejinho 2020-02-13 20:10:52 +09:00
parent 771b88b1b3
commit 52c70097fb

View File

@ -89,37 +89,43 @@ export class ListItemComponent implements OnInit {
this.defaultPath = 'assets/images/img_groupphoto_80.png'; this.defaultPath = 'assets/images/img_groupphoto_80.png';
break; break;
case RoomType.Mytalk: case RoomType.Mytalk:
if (!!this.roomUserInfo && !!this.loginRes) {
const me = this.roomUserInfo.filter( const me = this.roomUserInfo.filter(
v => v.seq === this.loginRes.userSeq v => v.seq === this.loginRes.userSeq
); );
if (!!me && me.length > 0) { if (!!me && me.length > 0) {
this.imagePath = me[0].profileImageFile; this.imagePath = me[0].profileImageFile;
} }
}
break; break;
case RoomType.Single: case RoomType.Single:
case RoomType.Bot: case RoomType.Bot:
case RoomType.Allim: case RoomType.Allim:
case RoomType.Allim_Elephant: case RoomType.Allim_Elephant:
case RoomType.Allim_TMS: case RoomType.Allim_TMS:
if (!!this.roomUserInfo && !!this.loginRes) {
const others = this.roomUserInfo.filter( const others = this.roomUserInfo.filter(
v => v.seq !== this.loginRes.userSeq v => v.seq !== this.loginRes.userSeq
); );
if (!!others && others.length > 0) { if (!!others && others.length > 0) {
this.imagePath = others[0].profileImageFile; this.imagePath = others[0].profileImageFile;
} }
}
break; break;
} }
} }
get _roomUserInfos() { get _roomUserInfos() {
if (this.roomInfo.roomType === RoomType.Single) { if (this.roomInfo.roomType === RoomType.Single) {
return this.roomUserInfo.filter(roomUserInfo => { return this.roomUserInfo.filter(
return this.loginRes.userSeq !== roomUserInfo.seq; roomUserInfo =>
}); !!this.loginRes && this.loginRes.userSeq !== roomUserInfo.seq
);
} else { } else {
return this.roomUserInfo return this.roomUserInfo
.filter(roomUserInfo => { .filter(roomUserInfo => {
return ( return (
!!this.loginRes &&
this.loginRes.userSeq !== roomUserInfo.seq && this.loginRes.userSeq !== roomUserInfo.seq &&
roomUserInfo.isJoinRoom roomUserInfo.isJoinRoom
); );