🐛 (folders) Make sure to exit folder on workspace change

This commit is contained in:
Baptiste Arnaud
2024-02-06 12:26:20 +01:00
parent 5e9dfaaa49
commit c2603d99b1
6 changed files with 59 additions and 2 deletions

View File

@@ -50,7 +50,7 @@ export const WorkspaceProvider = ({
typebotId,
children,
}: WorkspaceContextProps) => {
const { pathname, query, push, isReady: isRouterReady } = useRouter()
const { pathname, query, push, isReady: isRouterReady, replace } = useRouter()
const { user } = useUser()
const userId = user?.id
const [workspaceId, setWorkspaceId] = useState<string | undefined>()
@@ -163,6 +163,7 @@ export const WorkspaceProvider = ({
const switchWorkspace = (workspaceId: string) => {
setWorkspaceIdInLocalStorage(workspaceId)
setWorkspaceId(workspaceId)
replace('/typebots')
}
const createWorkspace = async (userFullName?: string) => {