From a6c2eab54da87882d89af2dae2822c0c67d9d06f Mon Sep 17 00:00:00 2001 From: jelveh Date: Thu, 16 Jul 2026 19:46:15 -0700 Subject: [PATCH] fix: refresh Home "Recently used" apps instead of freezing them for the session loadRecentApps only hit /get-launch-apps when window.launch_apps.recent was empty. Once populated (typically at page load), every subsequent init/onActivate /focus just re-rendered the same cached array, so apps launched during the session never showed up under "Recently used" until a hard reload. Drop the empty-list guard so the list refetches on the same triggers that already refresh the usage cards. The fetch can only make the list fresher. --- src/gui/src/UI/Dashboard/TabHome.js | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/gui/src/UI/Dashboard/TabHome.js b/src/gui/src/UI/Dashboard/TabHome.js index 3073a7d38..30c5ef53c 100644 --- a/src/gui/src/UI/Dashboard/TabHome.js +++ b/src/gui/src/UI/Dashboard/TabHome.js @@ -306,20 +306,21 @@ const TabHome = { }, async loadRecentApps($el_window) { - if (!window.launch_apps?.recent?.length) { - try { - window.launch_apps = await $.ajax({ - url: `${window.api_origin}/get-launch-apps?icon_size=64`, - type: 'GET', - async: true, - contentType: 'application/json', - headers: { - Authorization: `Bearer ${window.auth_token}`, - }, - }); - } catch (e) { - console.error('Failed to load launch apps:', e); - } + // Always refetch: gating on an empty list froze "Recently used" for the + // whole session (apps launched after load never appeared). loadUsageData + // refreshes on the same activate/focus triggers, so this stays in step. + try { + window.launch_apps = await $.ajax({ + url: `${window.api_origin}/get-launch-apps?icon_size=64`, + type: 'GET', + async: true, + contentType: 'application/json', + headers: { + Authorization: `Bearer ${window.auth_token}`, + }, + }); + } catch (e) { + console.error('Failed to load launch apps:', e); } $el_window .find('.bento-recent-apps-container')