mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 02:58:07 +00:00
Scroll to today's meeting when the meeting view appears
This commit is contained in:
parent
dc722938c1
commit
54fa7be51d
2 changed files with 6 additions and 2 deletions
|
|
@ -153,11 +153,11 @@ struct MeetingsFragment: View {
|
|||
.listRowSeparator(.hidden)
|
||||
}
|
||||
.onAppear {
|
||||
proxyReader.scrollTo(meetingsListViewModel.todayIdx)
|
||||
proxyReader.scrollTo(meetingsListViewModel.todayIdx, anchor: .top)
|
||||
}
|
||||
.onReceive(NotificationCenter.default.publisher(for: MeetingsListViewModel.ScrollToTodayNotification)) { _ in
|
||||
withAnimation {
|
||||
proxyReader.scrollTo(meetingsListViewModel.todayIdx)
|
||||
proxyReader.scrollTo(meetingsListViewModel.todayIdx, anchor: .top)
|
||||
}
|
||||
}
|
||||
.safeAreaInset(edge: .top, content: {
|
||||
|
|
|
|||
|
|
@ -118,6 +118,10 @@ class MeetingsListViewModel: ObservableObject {
|
|||
self.todayIdx = todayIdx
|
||||
self.meetingsList = meetingsListTmp
|
||||
}
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
|
||||
NotificationCenter.default.post(name: MeetingsListViewModel.ScrollToTodayNotification, object: nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue