mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-09 15:28:58 +00:00
fixed infinite loading in dashboard
This commit is contained in:
@@ -188,6 +188,9 @@ export default function Dashboard() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
(async () => {
|
(async () => {
|
||||||
|
if(router.isReady && workspaceId === "undefined"){
|
||||||
|
router.push('/noprojects');
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const tempNumSnapshots = await getProjectSercetSnapshotsCount({
|
const tempNumSnapshots = await getProjectSercetSnapshotsCount({
|
||||||
workspaceId
|
workspaceId
|
||||||
|
|||||||
@@ -123,6 +123,9 @@ export const ProjectSettingsPage = () => {
|
|||||||
await deleteWorkspace.mutateAsync({ workspaceID });
|
await deleteWorkspace.mutateAsync({ workspaceID });
|
||||||
// redirect user to first workspace user is part of
|
// redirect user to first workspace user is part of
|
||||||
const ws = workspaces.find(({ _id }) => _id !== workspaceID);
|
const ws = workspaces.find(({ _id }) => _id !== workspaceID);
|
||||||
|
if(!ws){
|
||||||
|
router.push("/noprojects");
|
||||||
|
}
|
||||||
router.push(`/dashboard/${ws?._id}`);
|
router.push(`/dashboard/${ws?._id}`);
|
||||||
createNotification({
|
createNotification({
|
||||||
text: 'Successfully deleted workspace',
|
text: 'Successfully deleted workspace',
|
||||||
|
|||||||
Reference in New Issue
Block a user