This commit is contained in:
richard-loafle 2020-02-05 14:07:50 +09:00
commit 46faa2a675
4 changed files with 9 additions and 1 deletions

View File

@ -54,6 +54,7 @@
<ucap-room-list-item <ucap-room-list-item
*ngFor="let room of roomList" *ngFor="let room of roomList"
[loginRes]="loginRes" [loginRes]="loginRes"
[isSelected]="(selectedRoomInfo$ | async)?.roomSeq === room.roomSeq"
[roomInfo]="room" [roomInfo]="room"
[roomUserInfo]="getRoomUserList(room)" [roomUserInfo]="getRoomUserList(room)"
[sessionVerinfo]="sessionVerinfo" [sessionVerinfo]="sessionVerinfo"

View File

@ -64,6 +64,7 @@ export class ChatComponent implements OnInit, OnDestroy, AfterViewChecked {
loginRes: LoginResponse; loginRes: LoginResponse;
loginResSubscription: Subscription; loginResSubscription: Subscription;
selectedRoomInfo$: Observable<RoomInfo>;
roomSubscription: Subscription; roomSubscription: Subscription;
isSearch = false; isSearch = false;
@ -174,6 +175,10 @@ export class ChatComponent implements OnInit, OnDestroy, AfterViewChecked {
}) })
) )
.subscribe(); .subscribe();
this.selectedRoomInfo$ = this.store.pipe(
select(AppStore.MessengerSelector.RoomSelector.roomInfo)
);
} }
ngOnDestroy(): void { ngOnDestroy(): void {

View File

@ -1,4 +1,4 @@
<div class="list-item" matRipple> <div class="list-item" matRipple [ngClass]="isSelected ? 'selected' : ''">
<dl class="item-default"> <dl class="item-default">
<dt> <dt>
<div class="thumbnail-mask"> <div class="thumbnail-mask">

View File

@ -35,6 +35,8 @@ export class ListItemComponent implements OnInit {
@Input() @Input()
loginRes: LoginResponse; loginRes: LoginResponse;
@Input() @Input()
isSelected: boolean;
@Input()
roomInfo: RoomInfo; roomInfo: RoomInfo;
@Input() @Input()
roomUserInfo: (RoomUserInfo | UserInfoShort)[]; roomUserInfo: (RoomUserInfo | UserInfoShort)[];