mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-11 17:56:37 +08:00
fix(frontend): resolve login redirect loop and clean up info tab
- Prevent infinite session probe requests on the login page by guarding the check with the authenticated user state and using the Latest Ref pattern. - Decouple useEffect from resolveRedirectTarget by using resolveRedirectTargetRef to avoid searchParams dependency loops. - Remove the unused '服务连接' Card from the settings info tab and clean up unused imports, queries, and properties.
This commit is contained in:
@@ -35,12 +35,6 @@ export function SystemSettingsMain() {
|
||||
enabled: !!user?.is_admin,
|
||||
})
|
||||
|
||||
const authSourcesQuery = useQuery({
|
||||
queryKey: ["auth", "sources"],
|
||||
queryFn: () => AdminService.listAuthSources(),
|
||||
enabled: !!user?.is_admin,
|
||||
})
|
||||
|
||||
const configs = useMemo(
|
||||
() => systemConfigMap(systemConfigsQuery.data ?? []),
|
||||
[systemConfigsQuery.data],
|
||||
@@ -112,10 +106,7 @@ export function SystemSettingsMain() {
|
||||
<OtherTab configs={configs} />
|
||||
</TabsContent>
|
||||
<TabsContent value="info" className="pt-4">
|
||||
<InfoTab
|
||||
systemConfigsLength={systemConfigsQuery.data?.length ?? 0}
|
||||
authSourcesLength={authSourcesQuery.data?.length ?? 0}
|
||||
/>
|
||||
<InfoTab />
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
</motion.div>
|
||||
|
||||
Reference in New Issue
Block a user