fix(app): keep terminal mounted when switching session tabs in a workspace (#34852)
Co-authored-by: Brendan Allan <git@brendonovich.dev>
This commit is contained in:
parent
7d2618637f
commit
4a42caef2c
7 changed files with 501 additions and 58 deletions
|
|
@ -42,6 +42,20 @@ function unwrapNamedError(error: unknown): unknown {
|
|||
return error
|
||||
}
|
||||
|
||||
// Client-synthesized session not-found errors share one constructor and
|
||||
// predicate so the message contract cannot drift between the sync store
|
||||
// (server-session.ts), the route lineage (session-lineage.ts), and the
|
||||
// not-found fallback matching (session.tsx).
|
||||
const sessionNotFoundMessage = (sessionID: string) => `Session not found: ${sessionID}`
|
||||
|
||||
export function sessionNotFoundError(sessionID: string) {
|
||||
return new Error(sessionNotFoundMessage(sessionID))
|
||||
}
|
||||
|
||||
export function isLocalSessionNotFoundError(error: unknown, sessionID: string) {
|
||||
return error instanceof Error && error.message === sessionNotFoundMessage(sessionID)
|
||||
}
|
||||
|
||||
export function isSessionNotFoundError(error: unknown, sessionID: string) {
|
||||
const unwrapped = unwrapNamedError(error)
|
||||
if (typeof unwrapped !== "object" || unwrapped === null) return false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue