fix: saving logic
This commit is contained in:
@@ -121,6 +121,9 @@ struct MeetingDetailView: View {
|
||||
} message: {
|
||||
Text(viewModel.errorMessage ?? "")
|
||||
}
|
||||
.onDisappear {
|
||||
viewModel.saveMeeting()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Content Views
|
||||
|
||||
@@ -40,6 +40,9 @@ struct MeetingListView: View {
|
||||
.navigationDestination(for: Meeting.self) { meeting in
|
||||
MeetingDetailView(meeting: meeting)
|
||||
}
|
||||
.onAppear {
|
||||
viewModel.loadMeetings()
|
||||
}
|
||||
}
|
||||
.overlay {
|
||||
if viewModel.isLoading {
|
||||
@@ -54,8 +57,19 @@ struct MeetingRowView: View {
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Text(meeting.date, style: .date)
|
||||
.font(.headline)
|
||||
// Show title if exists, otherwise show date
|
||||
if !meeting.title.isEmpty {
|
||||
Text(meeting.title)
|
||||
.font(.headline)
|
||||
.lineLimit(1)
|
||||
|
||||
Text(meeting.date, style: .date)
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
} else {
|
||||
Text(meeting.date, style: .date)
|
||||
.font(.headline)
|
||||
}
|
||||
|
||||
if !meeting.transcript.isEmpty {
|
||||
Text(meeting.transcript)
|
||||
|
||||
Reference in New Issue
Block a user