chore: profile setting bug fixes (#3068)

* chore: change password page redirection fix

* chore: profile activity profile redirection fix
This commit is contained in:
Anmol Singh Bhatia 2023-12-11 17:30:17 +05:30 committed by GitHub
parent 8041b23a63
commit 82c0ee00a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 14 deletions

View File

@ -156,7 +156,9 @@ const ProfileActivityPage: NextPageWithLayout = () => {
{activityItem.actor_detail.first_name} Bot {activityItem.actor_detail.first_name} Bot
</span> </span>
) : ( ) : (
<Link href={`/${workspaceSlug}/profile/${activityItem.actor_detail.id}`}> <Link
href={`/${activityItem.workspace_detail.slug}/profile/${activityItem.actor_detail.id}`}
>
<span className="text-gray font-medium"> <span className="text-gray font-medium">
{activityItem.actor_detail.display_name} {activityItem.actor_detail.display_name}
</span> </span>

View File

@ -33,7 +33,7 @@ const ChangePasswordPage: NextPageWithLayout = observer(() => {
const [isPageLoading, setIsPageLoading] = useState(true); const [isPageLoading, setIsPageLoading] = useState(true);
const { const {
appConfig: { envConfig }, user: { currentUser },
} = useMobxStore(); } = useMobxStore();
const router = useRouter(); const router = useRouter();
@ -74,20 +74,11 @@ const ChangePasswordPage: NextPageWithLayout = observer(() => {
}; };
useEffect(() => { useEffect(() => {
if (!envConfig) return; if (!currentUser) return;
const enableEmailPassword = if (currentUser.is_password_autoset) router.push("/profile");
envConfig?.email_password_login ||
!(
envConfig?.email_password_login ||
envConfig?.magic_login ||
envConfig?.google_client_id ||
envConfig?.github_client_id
);
if (!enableEmailPassword) router.push("/profile");
else setIsPageLoading(false); else setIsPageLoading(false);
}, [envConfig, router]); }, [currentUser, router]);
if (isPageLoading) if (isPageLoading)
return ( return (