Merge pull request #370 from Neeraj138/login-after-delete-all-projects

Fix: Unable to login after deleting all projects
This commit is contained in:
mv-turtle
2023-03-04 21:22:54 -08:00
committed by GitHub
2 changed files with 2 additions and 3 deletions

View File

@@ -219,8 +219,7 @@ export default function Dashboard() {
(async () => { (async () => {
if (router.isReady && workspaceId === 'undefined') { if (router.isReady && workspaceId === 'undefined') {
router.push('/noprojects'); router.push('/noprojects');
} } else try {
try {
const { push, query } = router const { push, query } = router
const tempNumSnapshots = await getProjectSercetSnapshotsCount({ const tempNumSnapshots = await getProjectSercetSnapshotsCount({
workspaceId workspaceId

View File

@@ -33,7 +33,7 @@ export default function Login() {
let userWorkspace; let userWorkspace;
try { try {
const userWorkspaces = await getWorkspaces(); const userWorkspaces = await getWorkspaces();
userWorkspace = userWorkspaces[0]._id; userWorkspace = userWorkspaces[0] && userWorkspaces[0]._id;
router.push(`/dashboard/${userWorkspace}`); router.push(`/dashboard/${userWorkspace}`);
} catch (error) { } catch (error) {
console.log('Error - Not logged in yet'); console.log('Error - Not logged in yet');