mirror of
https://github.com/zimplexing/OrionTV.git
synced 2026-02-04 03:36:29 +08:00
feat: enhance login status management and improve error logging across services
This commit is contained in:
@@ -19,15 +19,19 @@ export default function RootLayout() {
|
||||
const [loaded, error] = useFonts({
|
||||
SpaceMono: require("../assets/fonts/SpaceMono-Regular.ttf"),
|
||||
});
|
||||
const { loadSettings, remoteInputEnabled } = useSettingsStore();
|
||||
const { loadSettings, remoteInputEnabled, apiBaseUrl } = useSettingsStore();
|
||||
const { startServer, stopServer } = useRemoteControlStore();
|
||||
const { checkLoginStatus } = useAuthStore();
|
||||
|
||||
useEffect(() => {
|
||||
loadSettings().then(() => {
|
||||
checkLoginStatus();
|
||||
});
|
||||
}, [loadSettings, checkLoginStatus]);
|
||||
loadSettings();
|
||||
}, [loadSettings]);
|
||||
|
||||
useEffect(() => {
|
||||
if (apiBaseUrl) {
|
||||
checkLoginStatus(apiBaseUrl);
|
||||
}
|
||||
}, [apiBaseUrl, checkLoginStatus]);
|
||||
|
||||
useEffect(() => {
|
||||
if (loaded || error) {
|
||||
|
||||
@@ -59,7 +59,7 @@ export default function SearchScreen() {
|
||||
}
|
||||
} catch (err) {
|
||||
setError("搜索失败,请稍后重试。");
|
||||
console.error("Search failed:", err);
|
||||
console.info("Search failed:", err);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user