2
0

fix(e2e): 🐛 Pass tests

This commit is contained in:
Baptiste Arnaud
2022-05-14 11:53:03 -07:00
parent 4d9796c559
commit 731e646377
3 changed files with 3 additions and 2 deletions

View File

@ -51,7 +51,7 @@ export const WorkspaceContext = ({ children }: { children: ReactNode }) => {
)?.role
useEffect(() => {
if (!workspaces || workspaces.length === 0) return
if (!workspaces || workspaces.length === 0 || currentWorkspace) return
const lastWorspaceId = localStorage.getItem('workspaceId')
const defaultWorkspace = lastWorspaceId
? workspaces.find(byId(lastWorspaceId))
@ -105,6 +105,7 @@ export const WorkspaceContext = ({ children }: { children: ReactNode }) => {
mutate({
workspaces: [...workspaces, newWorkspace],
})
console.log(newWorkspace)
setCurrentWorkspace(newWorkspace)
}