fix(tasks): treat app:'system' as a sentinel so the LibrePortal logo renders
`libreportal config update` and `libreportal system update` tasks are
submitted with `task.app === 'system'` (see task-actions.js' configUpdate
+ systemUpdate). renderTaskIcons hit its first branch on any truthy
task.app and built an <img src="/icons/apps/system.svg"…> which 404s
(there is no per-app icon called "system"). The onerror handler then
hid the broken image, so those task rows showed only the 🛠️ type emoji
and no LibrePortal logo — visually inconsistent with sibling system-level
rows like "LibrePortal - Finalize Setup" (which happens to carry
`app: 'libreportal'`, matching a real icon, and renders correctly via
the same branch).
Treat `app: 'system'` as a category sentinel rather than a real slug:
skip the per-app icon path, fall through to the system-task branch that
loads /icons/libreportal.svg directly. That icon is already shipped + the
data shape stays intact ('system' is the meaningful category, not a lie
about the app identity).
Net: "LibrePortal - Apply Configuration" and "LibrePortal - System Update"
now show the LibrePortal logo alongside their type emoji, matching the
Setup / Update / Backup-All rows.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
This commit is contained in:
parent
6ca6320c88
commit
59ee92bd87
@ -1014,11 +1014,15 @@ class TasksManager {
|
|||||||
Keeps the layout consistent across every row regardless of source. */
|
Keeps the layout consistent across every row regardless of source. */
|
||||||
renderTaskIcons(task) {
|
renderTaskIcons(task) {
|
||||||
const typeIcon = `<span class="task-type-icon">${this.getTaskTypeIcon(task).icon}</span>`;
|
const typeIcon = `<span class="task-type-icon">${this.getTaskTypeIcon(task).icon}</span>`;
|
||||||
if (task.app) {
|
// `app: 'system'` is a category sentinel (config_update, system_update, …),
|
||||||
|
// not a real app slug, so it has no /icons/apps/system.svg — fall through
|
||||||
|
// to the LibrePortal-system branch so those tasks still get a logo.
|
||||||
|
const isSystemSentinel = task.app === 'system';
|
||||||
|
if (task.app && !isSystemSentinel) {
|
||||||
const appIconPath = this.getAppIconPath(task);
|
const appIconPath = this.getAppIconPath(task);
|
||||||
return `${typeIcon}<img src="${appIconPath}" alt="${task.app}" class="task-app-icon" onerror="this.style.display='none'">`;
|
return `${typeIcon}<img src="${appIconPath}" alt="${task.app}" class="task-app-icon" onerror="this.style.display='none'">`;
|
||||||
}
|
}
|
||||||
if (this.isLibrePortalSystemTask(task)) {
|
if (isSystemSentinel || this.isLibrePortalSystemTask(task)) {
|
||||||
return `${typeIcon}<img src="/icons/libreportal.svg" alt="LibrePortal" class="task-app-icon">`;
|
return `${typeIcon}<img src="/icons/libreportal.svg" alt="LibrePortal" class="task-app-icon">`;
|
||||||
}
|
}
|
||||||
return typeIcon;
|
return typeIcon;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user