fix initial selection

This commit is contained in:
B. Petersen
2025-08-22 16:07:02 +02:00
committed by bjoern
parent 5d7c701da8
commit 06130c7cd8
@@ -82,30 +82,23 @@ public class EphemeralMessagesDialog {
if (timespan == 0) {
return 0; // off
}
// Choose timespan close to the current one out of available options.
if (timespan < TimeUnit.MINUTES.toSeconds(5)) {
return 1; // 1 minute
}
if (timespan < TimeUnit.MINUTES.toSeconds(30)) {
return 2; // 5 minutes
}
if (timespan < TimeUnit.HOURS.toSeconds(1)) {
return 3; // 30 minutes
return 1; // 5 minutes
}
if (timespan < TimeUnit.DAYS.toSeconds(1)) {
return 4; // 1 hour
return 2; // 1 hour
}
if (timespan < TimeUnit.DAYS.toSeconds(7)) {
return 5; // 1 day
return 3; // 1 day
}
if (timespan < TimeUnit.DAYS.toSeconds(35)) {
return 6; // 1 week
return 4; // 1 week
}
if (timespan < TimeUnit.DAYS.toSeconds(365)) {
return 7; // 5 weeks
return 5; // 5 weeks
}
return 8; // 1 year
return 6; // 1 year
}
}