add billing
This commit is contained in:
@@ -56,7 +56,7 @@ export function WorkspaceProvider({
|
||||
}) {
|
||||
const { orgid } = useParams()
|
||||
const [activeWorkspace, setActiveWorkspace] = useState<Workspace | any>(
|
||||
() => workspaces.find((ws) => ws.id === orgid) || {}
|
||||
() => workspaces.find(({ id }) => id === orgid) || {}
|
||||
)
|
||||
|
||||
return (
|
||||
@@ -70,14 +70,13 @@ export function WorkspaceProvider({
|
||||
|
||||
export function WorkspaceSwitcher() {
|
||||
const location = useLocation()
|
||||
const { orgid } = useParams()
|
||||
const { isMobile, state } = useSidebar()
|
||||
const { activeWorkspace, setActiveWorkspace, workspaces } = useWorksapce()
|
||||
const [, fragment, _] = location.pathname.slice(1).split('/')
|
||||
|
||||
const onSelect = (ws: Workspace) => {
|
||||
setActiveWorkspace(ws)
|
||||
window.location.assign(`/${ws.id}/${fragment}`)
|
||||
const onSelect = (workspace: Workspace) => {
|
||||
setActiveWorkspace(workspace)
|
||||
window.location.assign(`/${workspace.id}/${fragment}`)
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user