Fix compose poll durations not being set/persisted
This commit is contained in:
parent
f7127b84d8
commit
2c9f00d19f
|
@ -22,11 +22,7 @@ struct ComposePollView: View {
|
|||
|
||||
@Environment(\.colorScheme) var colorScheme: ColorScheme
|
||||
|
||||
@State private var duration: Duration {
|
||||
didSet {
|
||||
poll.duration = duration.timeInterval
|
||||
}
|
||||
}
|
||||
@State private var duration: Duration
|
||||
|
||||
init(draft: Draft, poll: Draft.Poll) {
|
||||
self.draft = draft
|
||||
|
@ -84,6 +80,9 @@ struct ComposePollView: View {
|
|||
backgroundColor
|
||||
.cornerRadius(10)
|
||||
)
|
||||
.onChange(of: duration, perform: { (value) in
|
||||
poll.duration = value.timeInterval
|
||||
})
|
||||
}
|
||||
|
||||
private var backgroundColor: Color {
|
||||
|
|
Loading…
Reference in New Issue