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) => {
|
.then((status) => {
|
||||||
setHasPasskeys(status.hasPasskeys)
|
setHasPasskeys(status.hasPasskeys)
|
||||||
setAuthState(status.authenticated ? "authenticated" : "unauthenticated")
|
setAuthState(status.authenticated ? "authenticated" : "unauthenticated")
|
||||||
if (status.authenticated) {
|
|
||||||
refresh().catch((error) => setStatusMessage(`Ошибка загрузки: ${error.message}`))
|
|
||||||
api<AppSettings>("/api/settings").then(setAppSettings).catch(() => undefined)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
setAuthState("unauthenticated")
|
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(() => {
|
useEffect(() => {
|
||||||
if (authState !== "authenticated" || activeVideos.length === 0) return
|
if (authState !== "authenticated" || activeVideos.length === 0) return
|
||||||
const timer = window.setInterval(() => {
|
const timer = window.setInterval(() => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue