Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
GolnazCh committed Nov 12, 2023
1 parent e6bdff6 commit c27f71c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Binary file not shown.
10 changes: 10 additions & 0 deletions UpgradeUpsell/Views/settings/ChatView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,21 @@ struct ChatView: View {
.navigationBarTitle("Chat", displayMode: .inline)
}
}

// private func scrollToLastMessage(scrollView: ScrollViewProxy? = nil) {
// // Scroll to the last message
// withAnimation {
// scrollView?.scrollTo(dbHelper.messages.last?.id, anchor: .bottom)
// }
// }

private func listenForMessages() {
if let currnetUser = dbHelper.userProfile?.id {
dbHelper.listenForMessages(user1: currnetUser, user2: receiverUserID){ (messages ) in
dbHelper.messages = messages

// Scroll to the last message whenever new messages are added
// scrollToLastMessage()
}
}

Expand Down

0 comments on commit c27f71c

Please sign in to comment.