mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-13 19:20:04 +00:00
🐛 fix: workspace url sync (#15728)
* fix: workspace url sync * chore: remove billing as personal
This commit is contained in:
@@ -45,6 +45,21 @@ const parseFirstSegment = (pathname: string): string | null => {
|
||||
return match ? match[1] : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Whether `pathname`'s first segment could be an (as-yet-unresolved) workspace
|
||||
* slug — i.e. it's present and not one of the reserved root segments.
|
||||
*
|
||||
* Top-level rendering only needs to block on the workspace list (to avoid a
|
||||
* false 404 / wrong-scope paint) when this is `true`. On personal / reserved
|
||||
* routes (`/`, `/agent/...`, `/settings/...`) the list isn't required to render,
|
||||
* so callers can show personal context immediately and let the list hydrate in
|
||||
* the background.
|
||||
*/
|
||||
export const isWorkspaceSlugCandidatePath = (pathname: string): boolean => {
|
||||
const first = parseFirstSegment(pathname);
|
||||
return !!first && !RESERVED_FIRST_SEGMENTS.has(first);
|
||||
};
|
||||
|
||||
/**
|
||||
* URL is the source of truth for workspace context.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user