Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Building Sync-ups Tutorial] fixes in "Record meeting" chapter #3582

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct RecordMeetingView: View {
}
}
.padding()
.foregroundColor(store.syncUp.theme.accentColor)
.foregroundStyle(store.syncUp.theme.accentColor)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct RecordMeetingView: View {
}
}
.padding()
.foregroundColor(store.syncUp.theme.accentColor)
.foregroundStyle(store.syncUp.theme.accentColor)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct RecordMeetingView: View {
}
}
.padding()
.foregroundColor(store.syncUp.theme.accentColor)
.foregroundStyle(store.syncUp.theme.accentColor)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct RecordMeetingView: View {
}
}
.padding()
.foregroundColor(store.syncUp.theme.accentColor)
.foregroundStyle(store.syncUp.theme.accentColor)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct RecordMeetingView: View {
}
}
.padding()
.foregroundColor(store.syncUp.theme.accentColor)
.foregroundStyle(store.syncUp.theme.accentColor)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct RecordMeetingView: View {
}
}
.padding()
.foregroundColor(store.syncUp.theme.accentColor)
.foregroundStyle(store.syncUp.theme.accentColor)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct RecordMeetingView: View {
}
}
.padding()
.foregroundColor(store.syncUp.theme.accentColor)
.foregroundStyle(store.syncUp.theme.accentColor)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct RecordMeetingView: View {
}
}
.padding()
.foregroundColor(store.syncUp.theme.accentColor)
.foregroundStyle(store.syncUp.theme.accentColor)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct RecordMeetingView: View {
}
}
.padding()
.foregroundColor(store.syncUp.theme.accentColor)
.foregroundStyle(store.syncUp.theme.accentColor)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ComposableArchitecture
import Foundation
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📓 Added to compile de Date


@Reducer
struct RecordMeeting {
Expand Down Expand Up @@ -43,10 +44,12 @@ struct RecordMeeting {
let secondsPerAttendee = Int(state.syncUp.durationPerAttendee.components.seconds)
if state.secondsElapsed.isMultiple(of: secondsPerAttendee) {
if state.secondsElapsed == state.syncUp.duration.components.seconds {
state.syncUp.meetings.insert(
Meeting(id: Meeting.ID(), date: Date(), transcript: state.transcript),
at: 0
)
state.$syncUp.withLock {
_ = $0.meetings.insert(
Meeting(id: Meeting.ID(), date: Date(), transcript: state.transcript),
at: 0
)
}
}
state.speakerIndex += 1
}
Expand Down Expand Up @@ -84,7 +87,7 @@ struct RecordMeetingView: View {
}
}
.padding()
.foregroundColor(store.syncUp.theme.accentColor)
.foregroundStyle(store.syncUp.theme.accentColor)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ComposableArchitecture
import Foundation

@Reducer
struct RecordMeeting {
Expand Down Expand Up @@ -45,10 +46,12 @@ struct RecordMeeting {
let secondsPerAttendee = Int(state.syncUp.durationPerAttendee.components.seconds)
if state.secondsElapsed.isMultiple(of: secondsPerAttendee) {
if state.secondsElapsed == state.syncUp.duration.components.seconds {
state.syncUp.meetings.insert(
Meeting(id: Meeting.ID(), date: Date(), transcript: state.transcript),
at: 0
)
state.$syncUp.withLock {
_ = $0.meetings.insert(
Meeting(id: Meeting.ID(), date: Date(), transcript: state.transcript),
at: 0
)
}
return .run { _ in await dismiss() }
}
state.speakerIndex += 1
Expand Down Expand Up @@ -87,7 +90,7 @@ struct RecordMeetingView: View {
}
}
.padding()
.foregroundColor(store.syncUp.theme.accentColor)
.foregroundStyle(store.syncUp.theme.accentColor)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ComposableArchitecture
import Foundation

@Reducer
struct RecordMeeting {
Expand Down Expand Up @@ -45,10 +46,12 @@ struct RecordMeeting {
let secondsPerAttendee = Int(state.syncUp.durationPerAttendee.components.seconds)
if state.secondsElapsed.isMultiple(of: secondsPerAttendee) {
if state.secondsElapsed == state.syncUp.duration.components.seconds {
state.syncUp.meetings.insert(
Meeting(id: Meeting.ID(), date: Date(), transcript: state.transcript),
at: 0
)
state.$syncUp.withLock {
_ = $0.meetings.insert(
Meeting(id: Meeting.ID(), date: Date(), transcript: state.transcript),
at: 0
)
}
return .run { _ in await dismiss() }
}
state.speakerIndex += 1
Expand Down Expand Up @@ -87,7 +90,7 @@ struct RecordMeetingView: View {
}
}
.padding()
.foregroundColor(store.syncUp.theme.accentColor)
.foregroundStyle(store.syncUp.theme.accentColor)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ComposableArchitecture
import Foundation

@Reducer
struct RecordMeeting {
Expand Down Expand Up @@ -47,10 +48,12 @@ struct RecordMeeting {
let secondsPerAttendee = Int(state.syncUp.durationPerAttendee.components.seconds)
if state.secondsElapsed.isMultiple(of: secondsPerAttendee) {
if state.secondsElapsed == state.syncUp.duration.components.seconds {
state.syncUp.meetings.insert(
Meeting(id: Meeting.ID(), date: Date(), transcript: state.transcript),
at: 0
)
state.$syncUp.withLock {
_ = $0.meetings.insert(
Meeting(id: Meeting.ID(), date: Date(), transcript: state.transcript),
at: 0
)
}
return .run { _ in await dismiss() }
}
state.speakerIndex += 1
Expand Down Expand Up @@ -89,7 +92,7 @@ struct RecordMeetingView: View {
}
}
.padding()
.foregroundColor(store.syncUp.theme.accentColor)
.foregroundStyle(store.syncUp.theme.accentColor)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ struct RecordMeeting {
let secondsPerAttendee = Int(state.syncUp.durationPerAttendee.components.seconds)
if state.secondsElapsed.isMultiple(of: secondsPerAttendee) {
if state.secondsElapsed == state.syncUp.duration.components.seconds {
state.syncUp.meetings.insert(
Meeting(id: uuid(), date: now, transcript: state.transcript),
at: 0
)
state.$syncUp.withLock {
_ = $0.meetings.insert(
Meeting(id: uuid(), date: now, transcript: state.transcript),
at: 0
)
}
return .run { _ in await dismiss() }
}
state.speakerIndex += 1
Expand Down Expand Up @@ -89,7 +91,7 @@ struct RecordMeetingView: View {
}
}
.padding()
.foregroundColor(store.syncUp.theme.accentColor)
.foregroundStyle(store.syncUp.theme.accentColor)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ struct RecordMeeting {
let secondsPerAttendee = Int(state.syncUp.durationPerAttendee.components.seconds)
if state.secondsElapsed.isMultiple(of: secondsPerAttendee) {
if state.secondsElapsed == state.syncUp.duration.components.seconds {
state.syncUp.meetings.insert(
Meeting(id: uuid(), date: now, transcript: state.transcript),
at: 0
)
state.$syncUp.withLock {
_ = $0.meetings.insert(
Meeting(id: uuid(), date: now, transcript: state.transcript),
at: 0
)
}
return .run { _ in await dismiss() }
}
state.speakerIndex += 1
Expand Down Expand Up @@ -90,7 +92,7 @@ struct RecordMeetingView: View {
}
}
.padding()
.foregroundColor(store.syncUp.theme.accentColor)
.foregroundStyle(store.syncUp.theme.accentColor)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ struct RecordMeeting {
let secondsPerAttendee = Int(state.syncUp.durationPerAttendee.components.seconds)
if state.secondsElapsed.isMultiple(of: secondsPerAttendee) {
if state.secondsElapsed == state.syncUp.duration.components.seconds {
state.syncUp.meetings.insert(
Meeting(id: uuid(), date: now, transcript: state.transcript),
at: 0
)
state.$syncUp.withLock {
_ = $0.meetings.insert(
Meeting(id: uuid(), date: now, transcript: state.transcript),
at: 0
)
}
return .run { _ in await dismiss() }
}
state.speakerIndex += 1
Expand Down Expand Up @@ -89,7 +91,7 @@ struct RecordMeetingView: View {
}
}
.padding()
.foregroundColor(store.syncUp.theme.accentColor)
.foregroundStyle(store.syncUp.theme.accentColor)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ struct RecordMeeting {
let secondsPerAttendee = Int(state.syncUp.durationPerAttendee.components.seconds)
if state.secondsElapsed.isMultiple(of: secondsPerAttendee) {
if state.secondsElapsed == state.syncUp.duration.components.seconds {
state.syncUp.meetings.insert(
Meeting(id: uuid(), date: now, transcript: state.transcript),
at: 0
)
state.$syncUp.withLock {
_ = $0.meetings.insert(
Meeting(id: uuid(), date: now, transcript: state.transcript),
at: 0
)
}
return .run { _ in await dismiss() }
}
state.speakerIndex += 1
Expand Down Expand Up @@ -89,7 +91,7 @@ struct RecordMeetingView: View {
}
}
.padding()
.foregroundColor(store.syncUp.theme.accentColor)
.foregroundStyle(store.syncUp.theme.accentColor)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ struct RecordMeeting {
let secondsPerAttendee = Int(state.syncUp.durationPerAttendee.components.seconds)
if state.secondsElapsed.isMultiple(of: secondsPerAttendee) {
if state.secondsElapsed == state.syncUp.duration.components.seconds {
state.syncUp.meetings.insert(
Meeting(id: uuid(), date: now, transcript: state.transcript),
at: 0
)
state.$syncUp.withLock {
_ = $0.meetings.insert(
Meeting(id: uuid(), date: now, transcript: state.transcript),
at: 0
)
}
return .run { _ in await dismiss() }
}
state.speakerIndex += 1
Expand Down Expand Up @@ -97,7 +99,7 @@ struct RecordMeetingView: View {
}
}
.padding()
.foregroundColor(store.syncUp.theme.accentColor)
.foregroundStyle(store.syncUp.theme.accentColor)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ struct RecordMeeting {
let secondsPerAttendee = Int(state.syncUp.durationPerAttendee.components.seconds)
if state.secondsElapsed.isMultiple(of: secondsPerAttendee) {
if state.secondsElapsed == state.syncUp.duration.components.seconds {
state.syncUp.meetings.insert(
Meeting(id: uuid(), date: now, transcript: state.transcript),
at: 0
)
state.$syncUp.withLock {
_ = $0.meetings.insert(
Meeting(id: uuid(), date: now, transcript: state.transcript),
at: 0
)
}
return .run { _ in await dismiss() }
}
state.speakerIndex += 1
Expand Down Expand Up @@ -98,7 +100,7 @@ struct RecordMeetingView: View {
}
}
.padding()
.foregroundColor(store.syncUp.theme.accentColor)
.foregroundStyle(store.syncUp.theme.accentColor)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ struct RecordMeeting {
let secondsPerAttendee = Int(state.syncUp.durationPerAttendee.components.seconds)
if state.secondsElapsed.isMultiple(of: secondsPerAttendee) {
if state.secondsElapsed == state.syncUp.duration.components.seconds {
state.syncUp.meetings.insert(
Meeting(id: uuid(), date: now, transcript: state.transcript),
at: 0
)
state.$syncUp.withLock {
_ = $0.meetings.insert(
Meeting(id: uuid(), date: now, transcript: state.transcript),
at: 0
)
}
return .run { _ in await dismiss() }
}
state.speakerIndex += 1
Expand Down Expand Up @@ -104,7 +106,7 @@ struct RecordMeetingView: View {
}
}
.padding()
.foregroundColor(store.syncUp.theme.accentColor)
.foregroundStyle(store.syncUp.theme.accentColor)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Expand Down
Loading