Bound login code input length

This commit is contained in:
John Preston
2026-08-11 21:16:59 +04:00
parent c0d4cf14c6
commit 758bb8906f

View File

@@ -25,6 +25,7 @@ namespace Ui {
namespace {
constexpr auto kDigitNone = int(-1);
constexpr auto kMaxDigitsCount = 32;
[[nodiscard]] int Circular(int left, int right) {
return ((left % right) + right) % right;
@@ -178,6 +179,7 @@ QString CodeInput::accessibilityValue() const {
}
void CodeInput::setDigitsCountMax(int digitsCount) {
digitsCount = std::clamp(digitsCount, 1, kMaxDigitsCount);
_digitsCountMax = digitsCount;
_digits.clear();