Skip to content

Commit

Permalink
fix scroll on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
guinmoon committed Sep 11, 2023
1 parent 08da5e7 commit 6a56889
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion LLMFarm/Chats/ChatView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,14 @@ struct ChatView: View {
.onChange(of: aiChatModel.AI_typing){ ai_typing in
// .onChange(of: aiChatModel.messages.count){ count in
// Fix for theese https://developer.apple.com/forums/thread/712510
if #available(iOS 16.4, *) {
if #available(macOS 13.0, *){
if (aiChatModel.predicting){
scrollToBottom(with_animation: true)
}else{
scrollToBottom(with_animation: false)
}
}
if #available(iOS 16.4, *){
if (aiChatModel.predicting){
scrollToBottom(with_animation: true)
}else{
Expand Down Expand Up @@ -169,6 +176,9 @@ struct ChatView: View {
.disabled(chat_selection == nil)
.onAppear(){
scrollProxy = scrollView
if #available(macOS 13.0, *){
scrollToBottom(with_animation: false)
}
if #available(iOS 16.4, *) {
scrollToBottom(with_animation: false)
}
Expand Down

0 comments on commit 6a56889

Please sign in to comment.