From b6054fdc25b0d45c82f9a12f7b6066942cf9c16f Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Mon, 7 Mar 2022 21:30:18 -0800 Subject: [PATCH] Check for messages --- MeshtasticClient/Views/Messages/UserMessageList.swift | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/MeshtasticClient/Views/Messages/UserMessageList.swift b/MeshtasticClient/Views/Messages/UserMessageList.swift index f9308824..d45cf3c9 100644 --- a/MeshtasticClient/Views/Messages/UserMessageList.swift +++ b/MeshtasticClient/Views/Messages/UserMessageList.swift @@ -335,17 +335,20 @@ struct UserMessageList: View { self.bleManager.context = context self.bleManager.userSettings = userSettings - if allMessages.count > 0 { + if allMessages.count > 1 { - withAnimation(Animation.spring().delay(0.5)) { + withAnimation(Animation.spring().delay(1)) { scrollView.scrollTo(allMessages.firstIndex(of: allMessages.last! ), anchor: .bottom) } } }) .onChange(of: allMessages.count, perform: { count in - withAnimation(Animation.spring().delay(0.5)) { - scrollView.scrollTo(allMessages.firstIndex(of: allMessages.last! ), anchor: .bottom) + if count > 1 { + + withAnimation(Animation.spring().delay(1)) { + scrollView.scrollTo(allMessages.firstIndex(of: allMessages.last! ), anchor: .bottom) + } } }) }