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.
This commit is contained in:
jelveh
2026-07-16 19:50:37 -07:00
parent bc6122c9a4
commit a6c2eab54d
+15 -14
View File
@@ -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')