mirror of
https://github.com/fairyglade/ly.git
synced 2025-12-20 19:24:53 +00:00
Add option to allow empty password or not (closes #577)
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
12
src/main.zig
12
src/main.zig
@@ -686,7 +686,17 @@ pub fn main() !void {
|
||||
|
||||
update = true;
|
||||
},
|
||||
termbox.TB_KEY_ENTER => {
|
||||
termbox.TB_KEY_ENTER => authenticate: {
|
||||
if (!config.allow_empty_password and password.text.items.len == 0) {
|
||||
try info_line.addMessage(lang.err_empty_password, config.error_bg, config.error_fg);
|
||||
InfoLine.clearRendered(allocator, buffer) catch {
|
||||
try info_line.addMessage(lang.err_alloc, config.error_bg, config.error_fg);
|
||||
};
|
||||
info_line.label.draw();
|
||||
_ = termbox.tb_present();
|
||||
break :authenticate;
|
||||
}
|
||||
|
||||
try info_line.addMessage(lang.authenticating, config.bg, config.fg);
|
||||
InfoLine.clearRendered(allocator, buffer) catch {
|
||||
try info_line.addMessage(lang.err_alloc, config.error_bg, config.error_fg);
|
||||
|
||||
Reference in New Issue
Block a user