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