From 82c0ee00a3b6e7e9385e9752133b681c663622cb Mon Sep 17 00:00:00 2001
From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com>
Date: Mon, 11 Dec 2023 17:30:17 +0530
Subject: [PATCH] chore: profile setting bug fixes (#3068)
* chore: change password page redirection fix
* chore: profile activity profile redirection fix
---
web/pages/profile/activity.tsx | 4 +++-
web/pages/profile/change-password.tsx | 17 ++++-------------
2 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/web/pages/profile/activity.tsx b/web/pages/profile/activity.tsx
index 80873f0a7..744ecae64 100644
--- a/web/pages/profile/activity.tsx
+++ b/web/pages/profile/activity.tsx
@@ -156,7 +156,9 @@ const ProfileActivityPage: NextPageWithLayout = () => {
{activityItem.actor_detail.first_name} Bot
) : (
-
+
{activityItem.actor_detail.display_name}
diff --git a/web/pages/profile/change-password.tsx b/web/pages/profile/change-password.tsx
index 6bddf0734..85074269c 100644
--- a/web/pages/profile/change-password.tsx
+++ b/web/pages/profile/change-password.tsx
@@ -33,7 +33,7 @@ const ChangePasswordPage: NextPageWithLayout = observer(() => {
const [isPageLoading, setIsPageLoading] = useState(true);
const {
- appConfig: { envConfig },
+ user: { currentUser },
} = useMobxStore();
const router = useRouter();
@@ -74,20 +74,11 @@ const ChangePasswordPage: NextPageWithLayout = observer(() => {
};
useEffect(() => {
- if (!envConfig) return;
+ if (!currentUser) return;
- const enableEmailPassword =
- envConfig?.email_password_login ||
- !(
- envConfig?.email_password_login ||
- envConfig?.magic_login ||
- envConfig?.google_client_id ||
- envConfig?.github_client_id
- );
-
- if (!enableEmailPassword) router.push("/profile");
+ if (currentUser.is_password_autoset) router.push("/profile");
else setIsPageLoading(false);
- }, [envConfig, router]);
+ }, [currentUser, router]);
if (isPageLoading)
return (