Meeting cancellation: only delete meeting when pressing one of the confirmation popup buttons.

This commit is contained in:
QuentinArguillere 2024-08-18 22:57:54 +02:00
parent d729f7570a
commit fcce09843e
4 changed files with 14 additions and 12 deletions

View file

@ -1016,13 +1016,19 @@ struct ContentView: View {
if isShowSendCancelMeetingNotificationPopup {
PopupView(isShowPopup: $isShowSendCancelMeetingNotificationPopup,
title: Text("The meeting has been cancelled"),
title: Text("The meeting will be cancelled"),
content: Text("Send notification to participants ?"),
titleFirstButton: Text("Cancel"),
actionFirstButton: { self.isShowSendCancelMeetingNotificationPopup.toggle() },
titleSecondButton: Text("Ok"),
titleFirstButton: Text("Cancel for me only"),
actionFirstButton: {
meetingViewModel.displayedMeeting = nil
meetingsListViewModel.deleteSelectedMeeting()
self.isShowSendCancelMeetingNotificationPopup.toggle(
) },
titleSecondButton: Text("Send cancellation notifications"),
actionSecondButton: {
meetingViewModel.displayedMeeting = nil
if let meetingToDelete = self.meetingsListViewModel.selectedMeetingToDelete {
meetingsListViewModel.deleteSelectedMeeting()
// We're in the meeting list view
self.meetingViewModel.sendMeetingCancelledNotifications(meeting: meetingToDelete)
self.isShowSendCancelMeetingNotificationPopup.toggle()

View file

@ -111,8 +111,6 @@ struct MeetingFragment: View {
Button(role: .destructive) {
withAnimation {
meetingsListViewModel.selectedMeetingToDelete = meetingViewModel.displayedMeeting
meetingViewModel.displayedMeeting = nil
meetingsListViewModel.deleteSelectedMeeting()
isShowSendCancelMeetingNotificationPopup.toggle()
}
} label: {

View file

@ -53,7 +53,6 @@ struct MeetingsListBottomSheet: View {
}
Button {
meetingsListViewModel.deleteSelectedMeeting()
CoreContext.shared.doOnCoreQueue { core in
if let organizerUri = self.meetingsListViewModel.selectedMeetingToDelete?.confInfo.organizer {
if core.defaultAccount?.contactAddress?.weakEqual(address2: organizerUri) ?? false {

View file

@ -359,10 +359,9 @@ class MeetingViewModel: ObservableObject {
}
func sendMeetingCancelledNotifications(meeting: MeetingModel) {
Log.error("\(MeetingViewModel.TAG) - sendMeetingCancelledNotifications TODO")
//CoreContext.shared.doOnCoreQueue { core in
// self.resetConferenceSchedulerAndListeners(core: core)
// self.conferenceScheduler?.cancelConference(conferenceInfo: meeting.confInfo)
//}
CoreContext.shared.doOnCoreQueue { core in
self.resetConferenceSchedulerAndListeners(core: core)
self.conferenceScheduler?.cancelConference(conferenceInfo: meeting.confInfo)
}
}
}