Skip to content

Commit f49fe81

Browse files
authored
Communication: Properly scroll to new posting when forwarded messages exist (#11122)
1 parent 8e038b2 commit f49fe81

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/webapp/app/communication/course-conversations-components/layout/conversation-messages/conversation-messages.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,6 @@ export class ConversationMessagesComponent implements OnInit, AfterViewInit, OnD
211211
this.messages.changes.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {
212212
if (!this.createdNewMessage && this.posts.length > 0) {
213213
this.scrollToStoredId();
214-
} else {
215-
this.createdNewMessage = false;
216214
}
217215
});
218216
this.content.nativeElement.addEventListener('scroll', () => {
@@ -407,6 +405,10 @@ export class ConversationMessagesComponent implements OnInit, AfterViewInit, OnD
407405

408406
this.groupPosts();
409407
this.cdr.markForCheck();
408+
if (this.createdNewMessage) {
409+
this.scrollToBottomOfMessages();
410+
this.createdNewMessage = false;
411+
}
410412
});
411413
});
412414
};

0 commit comments

Comments
 (0)