mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-22 22:48:08 +02:00
fix(settings): resolve ReferenceError and add detailed persistence logs
This commit is contained in:
1 parent
85215565fa
commit
1c5fe4499a
2 files changed
+7
-5
No files matched your search
@@ -90,10 +90,6 @@ export default function SettingsPage() {
|
|||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
if (!isMounted) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const reloadFromServer = async () => {
|
const reloadFromServer = async () => {
|
||||||
const config = await getSavedDatabaseConfig();
|
const config = await getSavedDatabaseConfig();
|
||||||
if (config) {
|
if (config) {
|
||||||
@@ -147,6 +143,10 @@ export default function SettingsPage() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!isMounted) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-6 max-w-xl">
|
<div className="space-y-6 max-w-xl">
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -64,7 +64,9 @@ export async function getSavedDatabaseConfig(): Promise<DbConfig | null> {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const data = await fs.readFile(CONFIG_FILE, "utf-8");
|
const data = await fs.readFile(CONFIG_FILE, "utf-8");
|
||||||
return JSON.parse(data);
|
const config = JSON.parse(data);
|
||||||
|
console.log(`[Settings] Config read from ${CONFIG_FILE}. Key present: ${!!config.openRouterKey}, Model: ${config.openRouterModel || "default"}`);
|
||||||
|
return config;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`[Settings] Error reading config from ${CONFIG_FILE}:`, error);
|
console.error(`[Settings] Error reading config from ${CONFIG_FILE}:`, error);
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in new issue
Block a user