Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0703fc6

Browse files
committed
fix: track login page correctly (#13618)
(cherry picked from commit495eea4)
1 parenta9e5648 commit0703fc6

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

‎site/src/pages/LoginPage/LoginPage.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
importtype{FC}from"react";
1+
import{useEffect,typeFC}from"react";
22
import{Helmet}from"react-helmet-async";
33
import{useQuery}from"react-query";
44
import{Navigate,useLocation,useNavigate}from"react-router-dom";
@@ -24,10 +24,21 @@ export const LoginPage: FC = () => {
2424
constredirectTo=retrieveRedirect(location.search);
2525
constapplicationName=getApplicationName();
2626
constnavigate=useNavigate();
27-
2827
const{ metadata}=useEmbeddedMetadata();
2928
constbuildInfoQuery=useQuery(buildInfo(metadata["build-info"]));
3029

30+
useEffect(()=>{
31+
if(!buildInfoQuery.data||isSignedIn){
32+
// isSignedIn already tracks with window.href!
33+
return;
34+
}
35+
// This uses `navigator.sendBeacon`, so navigating away will not prevent it!
36+
sendDeploymentEvent(buildInfoQuery.data,{
37+
type:"deployment_login",
38+
user_id:user?.id,
39+
});
40+
},[isSignedIn,buildInfoQuery.data,user?.id]);
41+
3142
if(isSignedIn){
3243
// If the redirect is going to a workspace application, and we
3344
// are missing authentication, then we need to change the href location

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp