diff --git a/components/projects/moveProjectPopup.tsx b/components/projects/moveProjectPopup.tsx index ed88088fa..9a03d3005 100644 --- a/components/projects/moveProjectPopup.tsx +++ b/components/projects/moveProjectPopup.tsx @@ -36,7 +36,7 @@ export default function MoveProjectPopup({ }) const onLoadTextInput = useCallback((node: HTMLInputElement | null) => node?.focus(), []) - const allWorkspaces = [...workspaces, ...addedWorkspaces] + const properWorkspaces = [...workspaces, ...addedWorkspaces].filter(workspace => workspace.id !== user.id) return ( @@ -70,18 +70,16 @@ export default function MoveProjectPopup({ checked={project.workspaceID === userWorkspace.id} /> )} - {allWorkspaces.length > 0 && Workspaces} - {allWorkspaces - .filter(workspace => workspace.id !== user.id) - .map((workspace, index) => ( - moveToWorkspace(workspace.id))} - checked={project.workspaceID === workspace.id} - /> - ))} + {properWorkspaces.length > 0 && Workspaces} + {properWorkspaces.map((workspace, index) => ( + moveToWorkspace(workspace.id))} + checked={project.workspaceID === workspace.id} + /> + ))} setNewWorkspaceName('')} />{' '}