diff --git a/frontend/src/components/BrowserSession.tsx b/frontend/src/components/BrowserSession.tsx index 89b83529..c12bbaa3 100644 --- a/frontend/src/components/BrowserSession.tsx +++ b/frontend/src/components/BrowserSession.tsx @@ -27,6 +27,7 @@ const FRAGMENT = graphql(/* GraphQL */ ` fragment BrowserSession_session on BrowserSession { id createdAt + finishedAt lastAuthentication { id createdAt @@ -92,15 +93,22 @@ const BrowserSession: React.FC = ({ session, isCurrent }) => { const sessionName = isCurrent ? "Current browser session" : "Browser session"; return ( - - + + {!data.finishedAt && ( + + )} ); }; diff --git a/frontend/src/gql/gql.ts b/frontend/src/gql/gql.ts index 5daaaba6..32e80eec 100644 --- a/frontend/src/gql/gql.ts +++ b/frontend/src/gql/gql.ts @@ -19,7 +19,7 @@ const documents = { types.CurrentViewerSessionQueryDocument, "\n mutation AddEmail($userId: ID!, $email: String!) {\n addEmail(input: { userId: $userId, email: $email }) {\n status\n email {\n id\n ...UserEmail_email\n }\n }\n }\n": types.AddEmailDocument, - "\n fragment BrowserSession_session on BrowserSession {\n id\n createdAt\n lastAuthentication {\n id\n createdAt\n }\n }\n": + "\n fragment BrowserSession_session on BrowserSession {\n id\n createdAt\n finishedAt\n lastAuthentication {\n id\n createdAt\n }\n }\n": types.BrowserSession_SessionFragmentDoc, "\n mutation EndBrowserSession($id: ID!) {\n endBrowserSession(input: { browserSessionId: $id }) {\n status\n browserSession {\n id\n ...BrowserSession_session\n }\n }\n }\n": types.EndBrowserSessionDocument, @@ -105,8 +105,8 @@ export function graphql( * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function graphql( - source: "\n fragment BrowserSession_session on BrowserSession {\n id\n createdAt\n lastAuthentication {\n id\n createdAt\n }\n }\n", -): (typeof documents)["\n fragment BrowserSession_session on BrowserSession {\n id\n createdAt\n lastAuthentication {\n id\n createdAt\n }\n }\n"]; + source: "\n fragment BrowserSession_session on BrowserSession {\n id\n createdAt\n finishedAt\n lastAuthentication {\n id\n createdAt\n }\n }\n", +): (typeof documents)["\n fragment BrowserSession_session on BrowserSession {\n id\n createdAt\n finishedAt\n lastAuthentication {\n id\n createdAt\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/frontend/src/gql/graphql.ts b/frontend/src/gql/graphql.ts index 645a1cc6..f733fdc3 100644 --- a/frontend/src/gql/graphql.ts +++ b/frontend/src/gql/graphql.ts @@ -940,6 +940,7 @@ export type BrowserSession_SessionFragment = { __typename?: "BrowserSession"; id: string; createdAt: any; + finishedAt?: any | null; lastAuthentication?: { __typename?: "Authentication"; id: string; @@ -1405,6 +1406,7 @@ export const BrowserSession_SessionFragmentDoc = { selections: [ { kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "createdAt" } }, + { kind: "Field", name: { kind: "Name", value: "finishedAt" } }, { kind: "Field", name: { kind: "Name", value: "lastAuthentication" }, @@ -2024,6 +2026,7 @@ export const EndBrowserSessionDocument = { selections: [ { kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "createdAt" } }, + { kind: "Field", name: { kind: "Name", value: "finishedAt" } }, { kind: "Field", name: { kind: "Name", value: "lastAuthentication" }, @@ -2254,6 +2257,7 @@ export const BrowserSessionListDocument = { selections: [ { kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "createdAt" } }, + { kind: "Field", name: { kind: "Name", value: "finishedAt" } }, { kind: "Field", name: { kind: "Name", value: "lastAuthentication" },