Redirect to the project view if no active workspace (#4882)

This commit is contained in:
James Gatz 2022-06-21 18:50:43 +02:00 committed by Filipe Freire
parent 07706d093a
commit 38a53e603b

View File

@ -33,7 +33,7 @@ import { VCS } from '../../sync/vcs/vcs';
import { CookieModifyModal } from '../components/modals/cookie-modify-modal';
import { AppProps } from '../containers/app';
import { GrpcDispatchModalWrapper } from '../context/grpc';
import { selectActiveActivity } from '../redux/selectors';
import { selectActiveActivity, selectActiveWorkspace } from '../redux/selectors';
import { DropdownButton } from './base/dropdown/dropdown-button';
import GitSyncDropdown from './dropdowns/git-sync-dropdown';
import { ErrorBoundary } from './error-boundary';
@ -109,7 +109,10 @@ preloadWrapperDesign();
preloadWrapperUnitTest();
const ActivityRouter = () => {
const activity = useSelector(selectActiveActivity);
const selectedActivity = useSelector(selectActiveActivity);
const activeWorkspace = useSelector(selectActiveWorkspace);
// If there is no active workspace, we want to navigate to home no matter what the previous activity was
const activity = activeWorkspace ? selectedActivity : ACTIVITY_HOME;
const navigate = useNavigate();
React.useEffect(() => {