mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-03-30 16:25:57 +00:00
ios: prevent scrolling terminal view every time detail view is closed
This commit is contained in:
@@ -21,6 +21,7 @@ struct TerminalView: View {
|
||||
@FocusState private var keyboardVisible: Bool
|
||||
@State var authorized = !UserDefaults.standard.bool(forKey: DEFAULT_PERFORM_LA)
|
||||
@State private var terminalItem: TerminalItem?
|
||||
@State private var scrolled = false
|
||||
|
||||
var body: some View {
|
||||
if authorized {
|
||||
@@ -51,7 +52,12 @@ struct TerminalView: View {
|
||||
.padding(.horizontal)
|
||||
}
|
||||
}
|
||||
.onAppear { scrollToBottom(proxy) }
|
||||
.onAppear {
|
||||
if !scrolled {
|
||||
scrollToBottom(proxy)
|
||||
scrolled = true
|
||||
}
|
||||
}
|
||||
.onChange(of: chatModel.terminalItems.count) { _ in scrollToBottom(proxy) }
|
||||
.onChange(of: keyboardVisible) { _ in
|
||||
if keyboardVisible {
|
||||
|
||||
Reference in New Issue
Block a user