feat: enhance login status management and improve error logging across services

This commit is contained in:
zimplexing
2025-07-15 21:41:38 +08:00
parent 116cf12ca3
commit d44e9fe9ae
17 changed files with 62 additions and 57 deletions

View File

@@ -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) {

View File

@@ -59,7 +59,7 @@ export default function SearchScreen() {
}
} catch (err) {
setError("搜索失败,请稍后重试。");
console.error("Search failed:", err);
console.info("Search failed:", err);
} finally {
setLoading(false);
}