chore: handled onboarding step error in web app

This commit is contained in:
gurusainath 2024-05-02 19:53:39 +05:30
parent b717d1660c
commit 85a64955b7
6 changed files with 2 additions and 35 deletions

View File

@ -37,6 +37,7 @@
"nprogress": "^0.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-dropzone": "^14.2.3",
"react-hook-form": "^7.38.0",
"swr": "^2.2.2",
"tailwind-merge": "^2.0.0",

View File

@ -24,7 +24,6 @@ export const PreferencesMobileHeader = () => {
<Link
key={index}
href={link.href}
onClick={() => console.log(router.asPath)}
className={cn(
"flex justify-around py-2 w-full",
router.asPath.includes(link.label.toLowerCase()) ? "border-b-2 border-custom-primary-100" : ""

View File

@ -1,31 +0,0 @@
import { FC, ReactNode } from "react";
import { observer } from "mobx-react";
// hooks
import { useAppRouter } from "@/hooks/store";
// components
export interface IAdminAuthWrapper {
children: ReactNode;
}
export const AdminAuthWrapper: FC<IAdminAuthWrapper> = observer(({ children }) => {
// store hooks
const { workspaceSlug } = useAppRouter();
// FIXME:
// const { isUserInstanceAdmin, currentUserSettings } = useUser();
// redirect url
const redirectWorkspaceSlug =
workspaceSlug ||
// currentUserSettings?.workspace?.last_workspace_slug ||
// currentUserSettings?.workspace?.fallback_workspace_slug ||
"";
console.log("redirectWorkspaceSlug", redirectWorkspaceSlug);
// if user does not have admin access to the instance
// if (isUserInstanceAdmin !== undefined && isUserInstanceAdmin === false) {
// return <InstanceAdminRestriction redirectWorkspaceSlug={redirectWorkspaceSlug} />;
// }
return <>{children}</>;
});

View File

@ -1,3 +1,2 @@
export * from "./workspace-wrapper";
export * from "./project-wrapper";
export * from "./admin-wrapper";

View File

@ -141,7 +141,7 @@ const OnboardingPage: NextPageWithLayout = observer(() => {
handleStepChange();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [user, step, updateCurrentUser, workspacesList]);
}, [user, step, profile.onboarding_step, updateCurrentUser, workspacesList]);
return (
<>

View File

@ -106,7 +106,6 @@ export class UserStore implements IUserStore {
this.isLoading = false;
this.isAuthenticated = false;
});
console.log("this.isLoading", this.isLoading);
return user;
} catch (error) {
runInAction(() => {