chore: handled store loaders in the user

This commit is contained in:
gurusainath 2024-05-01 19:23:28 +05:30
parent 4054d52940
commit 9875f3319e
3 changed files with 7 additions and 7 deletions

View File

@ -72,6 +72,8 @@ export const AuthenticationWrapper: FC<TAuthenticationWrapper> = observer((props
if (isCurrentWorkspaceValid >= 0) redirectionRoute = `/${currentWorkspaceSlug}`;
console.log("redirectionRoute", redirectionRoute);
return redirectionRoute;
};
@ -113,11 +115,9 @@ export const AuthenticationWrapper: FC<TAuthenticationWrapper> = observer((props
if (pageType === EPageTypes.AUTHENTICATED) {
if (currentUser?.id) {
if (currentUserProfile?.is_onboarded) {
return <>{children}</>;
} else {
const currentRedirectRoute = getWorkspaceRedirectionUrl();
router.push(currentRedirectRoute);
if (currentUserProfile?.is_onboarded) return <>{children}</>;
else {
router.push(`/onboarding`);
return;
}
} else {

View File

@ -89,7 +89,7 @@ export class ProfileStore implements IProfileStore {
return userProfile;
} catch (error) {
runInAction(() => {
this.isLoading = true;
this.isLoading = false;
this.error = {
status: "error",
message: "Failed to fetch instance info",

View File

@ -65,7 +65,7 @@ export class UserSettingsStore implements IUserSettingsStore {
} catch (error) {
console.log("Failed to fetch profile details");
runInAction(() => {
this.isLoading = true;
this.isLoading = false;
this.error = {
status: "error",
message: "Failed to fetch instance info",