Fix HUD task bar not disappearing after accept/complete

Changed t.ID to t.TaskID in three places - the API returns TaskID
not ID, so filtering and lookups were failing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
John Mizerek 2026-02-08 14:52:50 -08:00
parent a318b8668f
commit a998ff890a

View file

@ -133,7 +133,7 @@ const HUD = {
existingBars.forEach(bar => existingIds.add(parseInt(bar.dataset.taskId))); existingBars.forEach(bar => existingIds.add(parseInt(bar.dataset.taskId)));
// Get current task IDs // Get current task IDs
const currentIds = new Set(this.tasks.map(t => t.ID)); const currentIds = new Set(this.tasks.map(t => t.TaskID));
// Remove bars for tasks that no longer exist // Remove bars for tasks that no longer exist
existingBars.forEach(bar => { existingBars.forEach(bar => {
@ -210,7 +210,7 @@ const HUD = {
const bars = document.querySelectorAll('.task-bar'); const bars = document.querySelectorAll('.task-bar');
bars.forEach(bar => { bars.forEach(bar => {
const taskId = parseInt(bar.dataset.taskId); const taskId = parseInt(bar.dataset.taskId);
const task = this.tasks.find(t => t.ID === taskId); const task = this.tasks.find(t => t.TaskID === taskId);
if (task) { if (task) {
this.updateTaskBar(bar, task); this.updateTaskBar(bar, task);
} }
@ -330,7 +330,7 @@ const HUD = {
if (data.OK) { if (data.OK) {
// Remove from local list immediately // Remove from local list immediately
this.tasks = this.tasks.filter(t => t.ID !== task.TaskID); this.tasks = this.tasks.filter(t => t.TaskID !== task.TaskID);
this.renderTasks(); this.renderTasks();
this.showFeedback('Task accepted!', 'success'); this.showFeedback('Task accepted!', 'success');
} else { } else {