Skip to content

Commit 7c1a97e

Browse files
committed
fix unread indicator
1 parent f05d250 commit 7c1a97e

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

renderer.ts

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -352,28 +352,14 @@ function addTab(sessionId: string, name: string) {
352352

353353
function markSessionAsUnread(sessionId: string) {
354354
const session = sessions.get(sessionId);
355-
if (!session) {
356-
console.log(`[Unread] ERROR: Session ${sessionId} not found`);
357-
return;
358-
}
355+
if (!session) return;
359356

360-
console.log(`[Unread] Setting hasUnreadActivity flag for session ${sessionId}`);
361357
session.hasUnreadActivity = true;
362358

363359
// Add unread indicator to tab
364360
const tab = document.getElementById(`tab-${sessionId}`);
365-
console.log(`[Unread] Tab element for ${sessionId}:`, tab);
366361
if (tab) {
367-
console.log(`[Unread] Tab classes before:`, tab.className);
368-
if (!tab.classList.contains("unread")) {
369-
tab.classList.add("unread");
370-
console.log(`[Unread] ✓ Added 'unread' class to tab ${sessionId}`);
371-
console.log(`[Unread] Tab classes after:`, tab.className);
372-
} else {
373-
console.log(`[Unread] Tab ${sessionId} already has 'unread' class`);
374-
}
375-
} else {
376-
console.log(`[Unread] ERROR: No tab element found for session ${sessionId}`);
362+
tab.classList.add("unread");
377363
}
378364
}
379365

@@ -521,7 +507,7 @@ ipcRenderer.on("session-output", (_event, sessionId: string, data: string) => {
521507
session.terminal.write(filteredData);
522508

523509
// Only mark as unread if this is not the active session
524-
if (activeSessionId !== sessionId && session.hasActivePty) {
510+
if (activeSessionId !== sessionId && session.hasActivePty && !session.hasUnreadActivity) {
525511
// Clear any existing idle timer
526512
const existingTimer = sessionIdleTimers.get(sessionId);
527513
if (existingTimer) {

0 commit comments

Comments
 (0)