Fix custom notification time error
This commit is contained in:
parent
10d0710637
commit
7cc560e705
1 changed files with 2 additions and 1 deletions
|
|
@ -24,6 +24,7 @@ Copyright (C) 2017, Nicholas Guriev <guriev-ns@ya.ru>
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
constexpr auto kForeverHours = 24 * 365;
|
constexpr auto kForeverHours = 24 * 365;
|
||||||
|
constexpr auto kForeverSeconds = kForeverHours * 3600;
|
||||||
constexpr auto kCustomFor = kForeverHours - 1;
|
constexpr auto kCustomFor = kForeverHours - 1;
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
@ -204,7 +205,7 @@ void MuteSettingsBox::prepare() {
|
||||||
const auto muteForSeconds = (group->value() == kCustomFor)
|
const auto muteForSeconds = (group->value() == kCustomFor)
|
||||||
? _forNumberInput->getLastText().toInt() * int(_period)
|
? _forNumberInput->getLastText().toInt() * int(_period)
|
||||||
: group->value() * 3600;
|
: group->value() * 3600;
|
||||||
if (muteForSeconds <= 0 || muteForSeconds > kForeverHours) {
|
if (muteForSeconds <= 0 || muteForSeconds > kForeverSeconds) {
|
||||||
_forNumberInput->showError();
|
_forNumberInput->showError();
|
||||||
} else {
|
} else {
|
||||||
_peer->owner().updateNotifySettings(
|
_peer->owner().updateNotifySettings(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue