MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / processDigit

Method processDigit

Telegram/SourceFiles/intro/intro_code_input.cpp:373–386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

371}
372
373void CodeInput::processDigit(int digit) {
374 _digits[_currentIndex]->setDigit(digit);
375 _currentIndex = Circular(_currentIndex + 1, _digits.size());
376 if (!_currentIndex) {
377 const auto result = collectDigits();
378 if (result.size() == _digitsCountMax) {
379 _codeCollected.fire_copy(result);
380 _currentIndex = _digits.size() - 1;
381 } else {
382 findEmptyAndPerform([&](int i) { _currentIndex = i; });
383 }
384 }
385 unfocusAll(_currentIndex);
386}
387
388} // namespace Ui

Callers

nothing calls this directly

Calls 3

CircularFunction · 0.85
setDigitMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected