INNER CODE UNIT · TypeScript

isChatRoutePath

opensquilla/opensquilla · opensquilla-webui/src/router/index.ts:36

function isChatRoutePath(path: string): boolean {
  return path === '/chat' || path === '/chat/new'
}

// ChatView is lazy-loaded, while App/Sidebar mounted hooks can run as soon as
// the root shell exists. Prime a singleton admission hold before resolving the
// lazy route so optional shell RPCs cannot enter the Gateway's serialized
// dispatcher ahead of session subscribe/snapshot/history. Query-only chat
// navigation reuses the mounted view and owns its hold through the coordinator.
router.beforeEach((to, from) => {
  const enteringChat = isChatRoutePath(to.path) && !isChatRoutePath(from.path)
  if (enteringChat) {
    primeSessionBootstrapAdmission()
  } else if (!isChatRoutePath(to.path)) {
    clearPrimedSessionBootstrapAdmission()
  }
})

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…