From 85ddbce127667ace47946d6de45be2c7e2c3a3e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Skr=C3=B8vseth?= Date: Wed, 11 Sep 2024 16:02:37 +0200 Subject: [PATCH] Call refresh OBO endpoint --- .../components/smart-editor/tabbed-editors/editor.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/src/components/smart-editor/tabbed-editors/editor.tsx b/frontend/src/components/smart-editor/tabbed-editors/editor.tsx index fd575e737..12937a427 100644 --- a/frontend/src/components/smart-editor/tabbed-editors/editor.tsx +++ b/frontend/src/components/smart-editor/tabbed-editors/editor.tsx @@ -162,6 +162,16 @@ const EditorWithNewCommentAndFloatingToolbar = ({ id }: { id: string }) => { useEffect(() => { console.log('isConnected', isConnected); + + const interval = setInterval(() => { + try { + fetch('/refresh-obo-access-token/kabal-api'); + } catch (e) { + console.warn('Failed to refresh OBO token.', e); + } + }, 10_000); + + return () => clearInterval(interval); }, [isConnected]); useEffect(() => {