Only show lang.err_lock_state once

Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion 2025-07-08 12:47:24 +02:00
parent ce17d346e8
commit 918e9ad5ac
No known key found for this signature in database
1 changed files with 3 additions and 1 deletions

View File

@ -102,6 +102,7 @@ pub fn main() !void {
var lang: Lang = undefined;
var save: Save = undefined;
var config_load_failed = false;
var can_get_lock_state = true;
if (res.args.help != 0) {
try clap.help(stderr, clap.Help, &params, .{});
@ -544,9 +545,10 @@ pub fn main() !void {
buffer.drawLabel(label_txt, buffer.box_x, buffer.box_y + buffer.box_height);
}
draw_lock_state: {
if (can_get_lock_state) draw_lock_state: {
const lock_state = interop.getLockState() catch {
try info_line.addMessage(lang.err_lock_state, config.error_bg, config.error_fg);
can_get_lock_state = false;
break :draw_lock_state;
};