Resume the dashboard chat from its own profile
It reopened whatever was touched last anywhere, so the card could land in a Scheduler troubleshooting thread with no picker to get back.
This commit is contained in:
@@ -2045,7 +2045,18 @@ vv_ai_profiles_script();
|
||||
// Do not clobber a conversation the operator has already started. The list arrives after
|
||||
// construction, so by the time it lands they may have typed and sent something.
|
||||
if (messages.length || busy) return;
|
||||
const last = d.chats.slice().sort((a, b) => (b.updated || 0) - (a.updated || 0))[0];
|
||||
|
||||
// A placement whose profile never moves should not resume a thread from one that does.
|
||||
// The store is shared on purpose — a conversation started on the dashboard is the one you
|
||||
// carry on in the tab — but reopening restores the saved profile too, so the Monitor
|
||||
// card would quietly turn into whatever the Scheduler was last troubleshooting. Filtered
|
||||
// where the page says its profile is fixed; unfiltered on the AI tab, where moving
|
||||
// between profiles is the point and the newest thread is genuinely the one you left.
|
||||
const want = o.resumeProfile || '';
|
||||
const pool = want ? d.chats.filter(c => (c.profile || 'chat') === want) : d.chats;
|
||||
if (!pool.length) return;
|
||||
|
||||
const last = pool.slice().sort((a, b) => (b.updated || 0) - (a.updated || 0))[0];
|
||||
if (last) loadChat(last.id);
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user