mirror of
https://github.com/stablyai/orca.git
synced 2026-10-20 00:03:45 +00:00
fix(mobile): clear terminal on empty snapshots
This commit is contained in:
@@ -1888,7 +1888,7 @@ export default function SessionScreen() {
|
||||
activeHandleRef.current = active.terminal
|
||||
setActiveHandle(active.terminal)
|
||||
subscribeToTerminal(active.terminal)
|
||||
} else if (active) {
|
||||
} else {
|
||||
const previous = activeHandleRef.current
|
||||
if (previous) {
|
||||
unsubscribeTerminal(previous)
|
||||
|
||||
@@ -7,6 +7,14 @@ const sessionRouteSource = readFileSync(
|
||||
)
|
||||
|
||||
describe('mobile session last-tab close', () => {
|
||||
it('clears terminal identity when the authoritative snapshot has no active tab', () => {
|
||||
const start = sessionRouteSource.indexOf('const applySessionTabs = useCallback')
|
||||
const end = sessionRouteSource.indexOf('const readMarkdownTab', start)
|
||||
const block = sessionRouteSource.slice(start, end)
|
||||
|
||||
expect(block).toContain('} else {\n const previous = activeHandleRef.current')
|
||||
})
|
||||
|
||||
it('clears stale active identity when closing leaves no tabs', () => {
|
||||
const start = sessionRouteSource.indexOf('async function handleCloseSessionTab')
|
||||
const end = sessionRouteSource.indexOf('const bulkCloseActions', start)
|
||||
|
||||
Reference in New Issue
Block a user