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

View File

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

View File

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