diff --git a/Linphone/UI/Main/Meetings/MeetingsView.swift b/Linphone/UI/Main/Meetings/MeetingsView.swift index 4af7b09f0..1591267c2 100644 --- a/Linphone/UI/Main/Meetings/MeetingsView.swift +++ b/Linphone/UI/Main/Meetings/MeetingsView.swift @@ -20,6 +20,7 @@ struct MeetingsView: View { Button { withAnimation { + scheduleMeetingViewModel.resetViewModelData() isShowScheduleMeetingFragment.toggle() } } label: { diff --git a/Linphone/UI/Main/Meetings/ViewModel/ScheduleMeetingViewModel.swift b/Linphone/UI/Main/Meetings/ViewModel/ScheduleMeetingViewModel.swift index 71260c046..d24333783 100644 --- a/Linphone/UI/Main/Meetings/ViewModel/ScheduleMeetingViewModel.swift +++ b/Linphone/UI/Main/Meetings/ViewModel/ScheduleMeetingViewModel.swift @@ -62,7 +62,27 @@ class ScheduleMeetingViewModel: ObservableObject { init() { fromDate = Calendar.current.date(byAdding: .hour, value: 1, to: Date.now)! toDate = Calendar.current.date(byAdding: .hour, value: 2, to: Date.now)! + computeDateLabels() + computeTimeLabels() + updateTimezone() + } + + func resetViewModelData() { + isBroadcastSelected = false + showBroadcastHelp = false + subject = "" + description = "" + allDayMeeting = false + timezone = "" + sendInvitations = true + participantsToAdd = [] + participants = [] + operationInProgress = false + conferenceCreatedEvent = false + searchField = "" + fromDate = Calendar.current.date(byAdding: .hour, value: 1, to: Date.now)! + toDate = Calendar.current.date(byAdding: .hour, value: 2, to: Date.now)! computeDateLabels() computeTimeLabels() updateTimezone()