From 212db9bb6c48b9b83ece061f9a6b51a17de6ff0f Mon Sep 17 00:00:00 2001 From: Manuel Scurti Date: Tue, 13 Jun 2023 12:46:02 +0200 Subject: [PATCH] lastSeenOnline storage key is internal Signed-off-by: Manuel Scurti --- packages/core-components/api-report.md | 4 ---- .../src/components/AutoLogoutProvider/disconnectedUsers.ts | 1 - .../src/components/AutoLogoutProvider/index.ts | 7 ++----- .../core-components/src/layout/SignInPage/providers.tsx | 4 ++-- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/packages/core-components/api-report.md b/packages/core-components/api-report.md index fa4d440031..388282a854 100644 --- a/packages/core-components/api-report.md +++ b/packages/core-components/api-report.md @@ -68,10 +68,6 @@ export type AlertDisplayProps = { transientTimeoutMs?: number; }; -// @public (undocumented) -export const AUTOLOGOUT_LAST_SEEN_ONLINE_STORAGE_KEY = - '@backstage/autologout:lastSeenOnline'; - // @public export const AutoLogoutProvider: ({ children, diff --git a/packages/core-components/src/components/AutoLogoutProvider/disconnectedUsers.ts b/packages/core-components/src/components/AutoLogoutProvider/disconnectedUsers.ts index 9920612794..c09e272eaa 100644 --- a/packages/core-components/src/components/AutoLogoutProvider/disconnectedUsers.ts +++ b/packages/core-components/src/components/AutoLogoutProvider/disconnectedUsers.ts @@ -18,7 +18,6 @@ import { useEffect } from 'react'; import { TimestampStore } from './timestampStore'; -/** @public */ export const LAST_SEEN_ONLINE_STORAGE_KEY = '@backstage/autologout:lastSeenOnline'; diff --git a/packages/core-components/src/components/AutoLogoutProvider/index.ts b/packages/core-components/src/components/AutoLogoutProvider/index.ts index 158c6a0ea4..600e3566d1 100644 --- a/packages/core-components/src/components/AutoLogoutProvider/index.ts +++ b/packages/core-components/src/components/AutoLogoutProvider/index.ts @@ -1,5 +1,3 @@ -import { LAST_SEEN_ONLINE_STORAGE_KEY } from './disconnectedUsers'; - /* * Copyright 2023 The Backstage Authors * @@ -18,6 +16,5 @@ import { LAST_SEEN_ONLINE_STORAGE_KEY } from './disconnectedUsers'; export * from './AutoLogoutProvider'; export * from './ConfigBasedAutoLogoutProvider'; -/** @public */ -export const AUTOLOGOUT_LAST_SEEN_ONLINE_STORAGE_KEY = - LAST_SEEN_ONLINE_STORAGE_KEY; +/** @internal */ +export { LAST_SEEN_ONLINE_STORAGE_KEY } from './disconnectedUsers'; diff --git a/packages/core-components/src/layout/SignInPage/providers.tsx b/packages/core-components/src/layout/SignInPage/providers.tsx index 3698f4cc4f..b4f3fa386f 100644 --- a/packages/core-components/src/layout/SignInPage/providers.tsx +++ b/packages/core-components/src/layout/SignInPage/providers.tsx @@ -31,7 +31,7 @@ import { commonProvider } from './commonProvider'; import { guestProvider } from './guestProvider'; import { customProvider } from './customProvider'; import { IdentityApiSignOutProxy } from './IdentityApiSignOutProxy'; -import { AUTOLOGOUT_LAST_SEEN_ONLINE_STORAGE_KEY } from '../../components'; +import { LAST_SEEN_ONLINE_STORAGE_KEY } from '../../components'; const PROVIDER_STORAGE_KEY = '@backstage/core:SignInPage:provider'; @@ -96,7 +96,7 @@ export const useSignInProviders = ( IdentityApiSignOutProxy.from({ identityApi, signOut: async () => { - localStorage.removeItem(AUTOLOGOUT_LAST_SEEN_ONLINE_STORAGE_KEY); + localStorage.removeItem(LAST_SEEN_ONLINE_STORAGE_KEY); localStorage.removeItem(PROVIDER_STORAGE_KEY); await identityApi.signOut?.(); },