Fix: Unable to login after deleting all projects

This commit is contained in:
Neeraj138
2023-02-24 23:37:10 +05:30
parent 3817e666a9
commit eebe3c164a
2 changed files with 2 additions and 3 deletions

View File

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

View File

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