reload dashboard after authentication
This commit is contained in:
parent
73077e760c
commit
5790c96a3d
1 changed files with 6 additions and 4 deletions
|
|
@ -1060,10 +1060,6 @@ export default function App() {
|
|||
.then((status) => {
|
||||
setHasPasskeys(status.hasPasskeys)
|
||||
setAuthState(status.authenticated ? "authenticated" : "unauthenticated")
|
||||
if (status.authenticated) {
|
||||
refresh().catch((error) => setStatusMessage(`Ошибка загрузки: ${error.message}`))
|
||||
api<AppSettings>("/api/settings").then(setAppSettings).catch(() => undefined)
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
setAuthState("unauthenticated")
|
||||
|
|
@ -1071,6 +1067,12 @@ export default function App() {
|
|||
})
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
if (authState !== "authenticated") return
|
||||
refresh().catch((error) => setStatusMessage(`Ошибка загрузки: ${error.message}`))
|
||||
api<AppSettings>("/api/settings").then(setAppSettings).catch(() => undefined)
|
||||
}, [authState])
|
||||
|
||||
useEffect(() => {
|
||||
if (authState !== "authenticated" || activeVideos.length === 0) return
|
||||
const timer = window.setInterval(() => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue