mirror of https://github.com/fairyglade/ly.git
Reduce nesting a bit
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
parent
ef64029795
commit
4fbbb6f0f2
23
src/main.zig
23
src/main.zig
|
@ -457,7 +457,19 @@ pub fn main() !void {
|
||||||
|
|
||||||
if (update) {
|
if (update) {
|
||||||
// If the user entered a wrong password 10 times in a row, play a cascade animation, else update normally
|
// If the user entered a wrong password 10 times in a row, play a cascade animation, else update normally
|
||||||
if (auth_fails < config.auth_fails) {
|
if (auth_fails >= config.auth_fails) {
|
||||||
|
std.Thread.sleep(std.time.ns_per_ms * 10);
|
||||||
|
update = buffer.cascade();
|
||||||
|
|
||||||
|
if (!update) {
|
||||||
|
std.Thread.sleep(std.time.ns_per_s * 7);
|
||||||
|
auth_fails = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
_ = termbox.tb_present();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
_ = termbox.tb_clear();
|
_ = termbox.tb_clear();
|
||||||
|
|
||||||
var length: usize = 0;
|
var length: usize = 0;
|
||||||
|
@ -600,15 +612,6 @@ pub fn main() !void {
|
||||||
session.label.draw();
|
session.label.draw();
|
||||||
login.label.draw();
|
login.label.draw();
|
||||||
password.draw();
|
password.draw();
|
||||||
} else {
|
|
||||||
std.Thread.sleep(std.time.ns_per_ms * 10);
|
|
||||||
update = buffer.cascade();
|
|
||||||
|
|
||||||
if (!update) {
|
|
||||||
std.Thread.sleep(std.time.ns_per_s * 7);
|
|
||||||
auth_fails = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_ = termbox.tb_present();
|
_ = termbox.tb_present();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue