mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: handled store loaders in the user
This commit is contained in:
parent
4054d52940
commit
9875f3319e
@ -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 {
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user