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
|
@Environment(\.colorScheme) var colorScheme: ColorScheme
|
||||||
|
|
||||||
@State private var duration: Duration {
|
@State private var duration: Duration
|
||||||
didSet {
|
|
||||||
poll.duration = duration.timeInterval
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
init(draft: Draft, poll: Draft.Poll) {
|
init(draft: Draft, poll: Draft.Poll) {
|
||||||
self.draft = draft
|
self.draft = draft
|
||||||
|
@ -84,6 +80,9 @@ struct ComposePollView: View {
|
||||||
backgroundColor
|
backgroundColor
|
||||||
.cornerRadius(10)
|
.cornerRadius(10)
|
||||||
)
|
)
|
||||||
|
.onChange(of: duration, perform: { (value) in
|
||||||
|
poll.duration = value.timeInterval
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private var backgroundColor: Color {
|
private var backgroundColor: Color {
|
||||||
|
|
Loading…
Reference in New Issue