bug of search is fixed

This commit is contained in:
richard-loafle 2020-02-06 15:30:25 +09:00
parent 14bd14340f
commit e2fde4ceb0
3 changed files with 79 additions and 65 deletions

View File

@ -145,65 +145,6 @@
>
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #contactMenu="matMenu">
<button
mat-menu-item
*ngIf="getShowContextMenu('OPEN_ALBUM_LIST')"
(click)="onClickContextMenu('OPEN_ALBUM_LIST')"
>
{{ 'chat.albumBox.label' | translate }}
</button>
<button
mat-menu-item
*ngIf="getShowContextMenu('OPEN_FILE_LIST')"
(click)="onClickContextMenu('OPEN_FILE_LIST')"
>
{{ 'chat.fileBox.label' | translate }}
</button>
<button
mat-menu-item
*ngIf="getShowContextMenu('CHAT_SEARCH')"
(click)="onClickContextMenu('CHAT_SEARCH')"
>
{{ 'chat.searchEventByText' | translate }}
</button>
<button
mat-menu-item
*ngIf="getShowContextMenu('OPEN_ROOM_USER')"
(click)="onClickContextMenu('OPEN_ROOM_USER')"
>
{{ 'chat.listOfRoomMember' | translate }}
</button>
<button
mat-menu-item
*ngIf="getShowContextMenu('ADD_MEMBER')"
(click)="onClickContextMenu('ADD_MEMBER')"
>
{{ 'chat.addMemberToRoom' | translate }}
</button>
<button
mat-menu-item
*ngIf="getShowContextMenu('ADD_GROUP')"
(click)="onClickContextMenu('ADD_GROUP')"
>
{{ 'chat.addMemberToGroup' | translate }}
</button>
<button
mat-menu-item
*ngIf="getShowContextMenu('EDIT_ROOM')"
(click)="onClickContextMenu('EDIT_ROOM')"
>
{{ 'chat.settingsOfRoom' | translate }}
</button>
<button
mat-menu-item
*ngIf="getShowContextMenu('CLOSE_ROOM')"
(click)="onClickContextMenu('CLOSE_ROOM')"
>
{{ 'chat.closeRoom' | translate }}
</button>
</mat-menu>
</div>
</div>
<div class="chat-search-frame">
@ -251,6 +192,7 @@
[eventRemained$]="eventRemainedSubject.asObservable()"
[userInfos$]="userInfoListSubject.asObservable()"
[loginRes$]="loginResSubject.asObservable()"
[lock$]="lockSubject.asObservable()"
[sessionVerInfo]="sessionVerInfo"
[isShowUnreadCount]="getShowUnreadCount()"
[clearReadHere]="clearReadHere"
@ -335,6 +277,65 @@
</div>
<!-- / CHAT -->
<mat-menu #contactMenu="matMenu">
<button
mat-menu-item
*ngIf="getShowContextMenu('OPEN_ALBUM_LIST')"
(click)="onClickContextMenu('OPEN_ALBUM_LIST')"
>
{{ 'chat.albumBox.label' | translate }}
</button>
<button
mat-menu-item
*ngIf="getShowContextMenu('OPEN_FILE_LIST')"
(click)="onClickContextMenu('OPEN_FILE_LIST')"
>
{{ 'chat.fileBox.label' | translate }}
</button>
<button
mat-menu-item
*ngIf="getShowContextMenu('CHAT_SEARCH')"
(click)="onClickContextMenu('CHAT_SEARCH')"
>
{{ 'chat.searchEventByText' | translate }}
</button>
<button
mat-menu-item
*ngIf="getShowContextMenu('OPEN_ROOM_USER')"
(click)="onClickContextMenu('OPEN_ROOM_USER')"
>
{{ 'chat.listOfRoomMember' | translate }}
</button>
<button
mat-menu-item
*ngIf="getShowContextMenu('ADD_MEMBER')"
(click)="onClickContextMenu('ADD_MEMBER')"
>
{{ 'chat.addMemberToRoom' | translate }}
</button>
<button
mat-menu-item
*ngIf="getShowContextMenu('ADD_GROUP')"
(click)="onClickContextMenu('ADD_GROUP')"
>
{{ 'chat.addMemberToGroup' | translate }}
</button>
<button
mat-menu-item
*ngIf="getShowContextMenu('EDIT_ROOM')"
(click)="onClickContextMenu('EDIT_ROOM')"
>
{{ 'chat.settingsOfRoom' | translate }}
</button>
<button
mat-menu-item
*ngIf="getShowContextMenu('CLOSE_ROOM')"
(click)="onClickContextMenu('CLOSE_ROOM')"
>
{{ 'chat.closeRoom' | translate }}
</button>
</mat-menu>
<div
style="visibility: hidden; position: fixed"
[style.left]="messageContextMenuPosition.x"
@ -355,14 +356,14 @@
<button
mat-menu-item
*ngIf="isForwardableMessage(message, eventInfoStatusSubject.value)"
(click)="onClickMessageContextMenu('REPLAY', message)"
(click)="onClickMessageContextMenu('FORWARD', message)"
>
{{ 'chat.forwardEventTo' | translate }}
</button>
<button
mat-menu-item
*ngIf="isForwardableMessage(message, eventInfoStatusSubject.value)"
(click)="onClickMessageContextMenu('REPLAY_TO_ME', message)"
(click)="onClickMessageContextMenu('FORWARD_TO_ME', message)"
>
{{ 'chat.forwardEventToMe' | translate }}
</button>

View File

@ -177,6 +177,8 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
eventRemainedSubscription: Subscription;
eventRemainedSubject = new BehaviorSubject<boolean>(false); // 이전대화가 남아 있는지 여부
lockSubject = new BehaviorSubject<boolean>(false);
sessionVerInfo: VersionInfo2Response;
baseEventSeq = 0;
@ -305,6 +307,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
)
)
.subscribe(process => {
this.lockSubject.next(process);
this.searchEventListProcessing = process;
if (!process && this.isShowSearchArea) {
this.doSearchTextInEvent(this.searchText);
@ -1355,7 +1358,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
}
}
break;
case 'REPLAY':
case 'FORWARD':
{
const result = await this.dialogService.open<
CreateChatDialogComponent,
@ -1401,7 +1404,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
}
}
break;
case 'REPLAY_TO_ME':
case 'FORWARD_TO_ME':
{
if (this.loginResSubject.value.talkWithMeBotSeq > -1) {
this.store.dispatch(
@ -1795,7 +1798,8 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
this.store.dispatch(EventStore.infoForSearchEnd({}));
this.chatMessages.gotoPosition(this.searchedFocusEvent.seq);
// this.chatMessages.gotoPosition(this.searchedFocusEvent.seq);
this.chatMessages.initEventMore(this.searchedFocusEvent.seq);
} else {
this.searchTotalCount = 0;
this.searchCurrentIndex = 0;

View File

@ -60,6 +60,9 @@ export class MessagesComponent implements OnInit, OnDestroy {
@Input()
userInfos$: Observable<UserInfo[]>;
@Input()
lock$: Observable<boolean>;
@Input()
isShowUnreadCount = true;
@Input()
@ -129,6 +132,7 @@ export class MessagesComponent implements OnInit, OnDestroy {
firstCheckReadHere = true;
initRoomLastEventSeq: number;
baseEventSeq = 0;
gotoEventSeq: number;
loginRes: LoginResponse;
loginResSubscription: Subscription;
@ -536,6 +540,10 @@ export class MessagesComponent implements OnInit, OnDestroy {
() => {},
() => {
this.initalized = true;
if (!!this.gotoEventSeq) {
this.gotoPosition(this.gotoEventSeq);
this.gotoEventSeq = undefined;
}
},
-1 === this.virtualScroller.viewPortInfo.endIndex ||
!isInViewPortItems,
@ -545,11 +553,12 @@ export class MessagesComponent implements OnInit, OnDestroy {
}
}
initEventMore() {
initEventMore(gotoEventSeq?: number) {
// 방정보가 바뀌면 이전대화 보기 관련 값들을 초기화 한다.
this.scrollUpInitalized = false;
this.storedScrollItem = undefined;
this.storedScrollItemOffsetTop = undefined;
this.gotoEventSeq = gotoEventSeq;
}
clear() {}