From 483facfa5658f839ffbd7d41fbb1f23f1e44964e Mon Sep 17 00:00:00 2001 From: Mara Date: Sat, 5 Apr 2025 19:31:04 +0200 Subject: [PATCH] Fix: Stable update info polling (#872) * adjusted sleep between polls to always sleep at least 2s * fixed tooltip formatting when no updates available --------- Co-authored-by: Mara --- scripts/checkUpdates.sh | 8 ++++++-- src/components/bar/modules/updates/index.tsx | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/checkUpdates.sh b/scripts/checkUpdates.sh index cff43db..c13d081 100755 --- a/scripts/checkUpdates.sh +++ b/scripts/checkUpdates.sh @@ -13,9 +13,13 @@ has_param() { wait_for_process_to_finish() { local process_name="$1" - while pgrep -a "$process_name" >/dev/null; do - sleep 0.1 + local pid + + while pid=$(pgrep -x "$process_name"); do + wait "$pid" 2>/dev/null || true done + + sleep 2 } check_arch_updates() { diff --git a/src/components/bar/modules/updates/index.tsx b/src/components/bar/modules/updates/index.tsx index a367150..cb0cb0f 100644 --- a/src/components/bar/modules/updates/index.tsx +++ b/src/components/bar/modules/updates/index.tsx @@ -34,7 +34,7 @@ const processUpdateCount = (updateCount: string): string => { const processUpdateTooltip = (updateTooltip: string, updateCount: Variable): string => { const defaultTooltip = updateCount.get() + ' updates available'; - if (!extendedTooltip.get()) return defaultTooltip; + if (!extendedTooltip.get() || !updateTooltip) return defaultTooltip; return defaultTooltip + '\n\n' + updateTooltip; };