fix: use async retry import

Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
Camila Belo
2024-03-12 10:15:58 +01:00
parent cd4afcf931
commit 125d635b13
@@ -45,7 +45,7 @@ import {
useApp,
useRouteRefParams,
} from '@backstage/core-plugin-api';
import { useAsyncRetry } from 'react-use';
import useAsyncRetry from 'react-use/lib/useAsyncRetry';
import { Button } from '@material-ui/core';
/* An explanation for the multiple ways of customizing the TechDocs reader page
@@ -182,7 +182,9 @@ function TechDocsAuthProvider({ children }: { children: ReactNode }) {
if (!value) return () => {};
channel.postMessage({ action: 'COOKIE_REFRESHED', payload: value });
let stopCookieRefresh = startCookieRefresh(value.expiresAt);
const handleMessage = (event: MessageEvent<any>): void => {
const handleMessage = (
event: MessageEvent<{ action: string; payload: { expiresAt: string } }>,
): void => {
const { action, payload } = event.data;
if (action === 'COOKIE_REFRESHED') {
stopCookieRefresh();