Skip to content

Commit

Permalink
in progress #566
Browse files Browse the repository at this point in the history
  • Loading branch information
szuperaz committed Apr 3, 2024
1 parent 1b1132d commit 5ae5c72
Showing 1 changed file with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ export class MessageListComponent
}

ngAfterViewChecked() {
console.log('itt');
if (!this.isViewInited) {
return;
}
Expand Down Expand Up @@ -498,7 +497,6 @@ export class MessageListComponent
this.hasNewMessages = false;
this.containerHeight = this.scrollContainer.nativeElement.scrollHeight;
} else if (this.olderMassagesLoaded) {
console.log('older messages loaded');
this.chatClientService.chatClient?.logger?.(
'info',
`Older messages are loaded, we preserve the scroll position`,
Expand Down Expand Up @@ -574,14 +572,6 @@ export class MessageListComponent
return;
}
const scrollPosition = this.getScrollPosition();
console.log(
'scrolled',
scrollPosition,
this.scrollContainer?.nativeElement?.scrollHeight,
this.scrollContainer?.nativeElement?.scrollTop,
this.scrollContainer?.nativeElement?.clientHeight,
this.isLoading
);
this.chatClientService.chatClient?.logger?.(
'info',
`Scrolled - scroll position: ${scrollPosition}, container height: ${this.scrollContainer.nativeElement.scrollHeight}`,
Expand Down Expand Up @@ -628,7 +618,6 @@ export class MessageListComponent
} else {
direction = scrollPosition.includes('top') ? 'older' : 'newer';
}
console.log('loading more messages');
const result =
this.mode === 'main'
? this.channelService.loadMoreMessages(direction)
Expand Down Expand Up @@ -708,11 +697,10 @@ export class MessageListComponent
currentScrollTop !== nextScrollTop &&
this.scrollContainer.nativeElement
) {
console.log('preserve scrollbar');
this.scrollContainer.nativeElement!.scrollTop = nextScrollTop;
if (this.isViewInited) {
this.cdRef.detectChanges();
}
// if (this.isViewInited) {
// this.cdRef.detectChanges();
// }
}
}

Expand Down

0 comments on commit 5ae5c72

Please sign in to comment.