3472: Give polls a default duration (#3473)
This commit is contained in:
parent
3fc1892c7d
commit
d754df8f07
1 changed files with 3 additions and 1 deletions
|
@ -75,8 +75,10 @@ fun showAddPollDialog(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val DAY_SECONDS = 60 * 60 * 24
|
||||||
|
val desiredDuration = poll?.expiresIn ?: DAY_SECONDS
|
||||||
val pollDurationId = durations.indexOfLast {
|
val pollDurationId = durations.indexOfLast {
|
||||||
it <= (poll?.expiresIn ?: 0)
|
it <= desiredDuration
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.pollDurationSpinner.setSelection(pollDurationId)
|
binding.pollDurationSpinner.setSelection(pollDurationId)
|
||||||
|
|
Loading…
Reference in a new issue