Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

ensu ios: avoid auto-scroll when generation completes

Prateek Sunal7497293979d6
diff --git a/mobile/native/darwin/Apps/ensu/ensu/Chat/MessageListView.swift b/mobile/native/darwin/Apps/ensu/ensu/Chat/MessageListView.swift
index c1405cdba7..5856658c4c 100644
--- a/mobile/native/darwin/Apps/ensu/ensu/Chat/MessageListView.swift
+++ b/mobile/native/darwin/Apps/ensu/ensu/Chat/MessageListView.swift
@@ -97,6 +97,7 @@ struct MessageListView: View {
private func handleScrollChange(_ newValue: ScrollChange, scrollProxy: ScrollViewProxy) {
let previous = lastScrollChange
lastScrollChange = newValue
+ let didGenerationJustFinish = previous.isGenerating && !newValue.isGenerating
if newValue.messagesCount != previous.messagesCount {
if !didInitialScroll {
@@ -127,7 +128,7 @@ struct MessageListView: View {
}
if newValue.inputBarHeight != previous.inputBarHeight {
- if autoScrollEnabled && !isUserDragging && !isGenerating {
+ if autoScrollEnabled && !isUserDragging && !isGenerating && !didGenerationJustFinish {
scrollToBottom(scrollProxy, force: true, animated: false)
}
}