From 5f7516e09bed713dfd27f4bc363d25af65c0d7f5 Mon Sep 17 00:00:00 2001 From: guinmoon Date: Mon, 11 Sep 2023 19:21:47 +0300 Subject: [PATCH] fix scroll --- LLMFarm/Chats/ChatView.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/LLMFarm/Chats/ChatView.swift b/LLMFarm/Chats/ChatView.swift index d1eef71..3211664 100644 --- a/LLMFarm/Chats/ChatView.swift +++ b/LLMFarm/Chats/ChatView.swift @@ -127,13 +127,13 @@ 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(macOS 13.0, *){ +#if os(macOS) if (aiChatModel.predicting){ scrollToBottom(with_animation: true) }else{ scrollToBottom(with_animation: false) } - } +#endif if #available(iOS 16.4, *){ if (aiChatModel.predicting){ scrollToBottom(with_animation: true) @@ -176,9 +176,9 @@ struct ChatView: View { .disabled(chat_selection == nil) .onAppear(){ scrollProxy = scrollView - if #available(macOS 13.0, *){ + #if os(macOS) scrollToBottom(with_animation: false) - } + #endif if #available(iOS 16.4, *) { scrollToBottom(with_animation: false) }