Skip to content

Commit 5e5f8a2

Browse files
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent c0cb896 commit 5e5f8a2

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

src/mainPage/menu.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,12 @@ const applyMenuCollapsedState = (navMenu: HTMLElement | null): void => {
6161

6262
const refreshAuthStateFromSession = async (): Promise<boolean> => {
6363
try {
64-
await authn.checkUser()
65-
if (!authn.currentUser()) {
66-
await authn.checkUser()
67-
}
68-
} catch (error) {
64+
const webId = await authn.checkUser()
65+
return Boolean(webId || authn.currentUser())
66+
} catch {
6967
// Keep the menu responsive even if auth refresh is transiently unavailable.
68+
return Boolean(authn.currentUser())
7069
}
71-
72-
return Boolean(authn.currentUser())
7370
}
7471

7572
const isLoggedIn = (): boolean => Boolean(authn.currentUser())

0 commit comments

Comments
 (0)