Skip to content

Commit 6cec5f5

Browse files
committed
snis_client: fix bug that update assets button didn't disable after d/l assets
Signed-off-by: Stephen M. Cameron <stephenmcameron@gmail.com>
1 parent f7fe436 commit 6cec5f5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

snis_client.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21640,6 +21640,8 @@ static void collect_process_stats(void)
2164021640
launcher_ui.snis_client_count = get_process_count("[/]snis_client") / 2;
2164121641
}
2164221642

21643+
static int already_checked_asset_update_time = 0;
21644+
2164321645
static void maybe_show_downloading_message(void)
2164421646
{
2164521647
static int framecounter = 0;
@@ -21668,6 +21670,8 @@ static void maybe_show_downloading_message(void)
2166821670
if (download_in_progress) {
2166921671
/* download has finished, unhide the restart button */
2167021672
ui_unhide_widget(launcher_ui.restart_btn);
21673+
/* make the asset update button get disabled */
21674+
already_checked_asset_update_time = 0;
2167121675
}
2167221676
}
2167321677
}
@@ -21680,15 +21684,14 @@ static void maybe_show_downloading_message(void)
2168021684

2168121685
static int assets_updated_too_recently(void)
2168221686
{
21683-
static int already_checked = 0;
2168421687
static int answer = 0;
2168521688

21686-
if (already_checked)
21689+
if (already_checked_asset_update_time)
2168721690
return answer;
2168821691

2168921692
char *last_update = xdg_base_slurp_file(xdg_base_ctx, "last_asset_update_time.txt");
2169021693
time_t last_update_time;
21691-
already_checked = 1;
21694+
already_checked_asset_update_time = 1;
2169221695

2169321696
if (!last_update) {
2169421697
answer = 0;

0 commit comments

Comments
 (0)