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

View File

@ -89,11 +89,13 @@ 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:
const me = this.roomUserInfo.filter( if (!!this.roomUserInfo && !!this.loginRes) {
v => v.seq === this.loginRes.userSeq const me = this.roomUserInfo.filter(
); v => v.seq === this.loginRes.userSeq
if (!!me && me.length > 0) { );
this.imagePath = me[0].profileImageFile; if (!!me && me.length > 0) {
this.imagePath = me[0].profileImageFile;
}
} }
break; break;
case RoomType.Single: case RoomType.Single:
@ -101,11 +103,13 @@ export class ListItemComponent implements OnInit {
case RoomType.Allim: case RoomType.Allim:
case RoomType.Allim_Elephant: case RoomType.Allim_Elephant:
case RoomType.Allim_TMS: case RoomType.Allim_TMS:
const others = this.roomUserInfo.filter( if (!!this.roomUserInfo && !!this.loginRes) {
v => v.seq !== this.loginRes.userSeq const others = this.roomUserInfo.filter(
); v => v.seq !== this.loginRes.userSeq
if (!!others && others.length > 0) { );
this.imagePath = others[0].profileImageFile; if (!!others && others.length > 0) {
this.imagePath = others[0].profileImageFile;
}
} }
break; break;
} }
@ -113,13 +117,15 @@ export class ListItemComponent implements OnInit {
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
); );