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}`;
|
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 {
|
||||||
|
@ -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",
|
||||||
|
@ -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",
|
||||||
|
Loading…
Reference in New Issue
Block a user