mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Check for messages
This commit is contained in:
parent
73fbfa2736
commit
b6054fdc25
1 changed files with 7 additions and 4 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue