Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

improve obsidian settings load

Louis Beaumontba835cff8059
diff --git a/pipes/obsidian/package.json b/pipes/obsidian/package.json
index 1a207011b..0e61dd280 100644
--- a/pipes/obsidian/package.json
+++ b/pipes/obsidian/package.json
@@ -1,6 +1,6 @@
{
"name": "obsidian",
- "version": "0.1.11",
+ "version": "0.1.12",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
diff --git a/pipes/obsidian/src/app/api/settings/route.ts b/pipes/obsidian/src/app/api/settings/route.ts
index 9bcd261cc..4646b26ad 100644
--- a/pipes/obsidian/src/app/api/settings/route.ts
+++ b/pipes/obsidian/src/app/api/settings/route.ts
@@ -13,8 +13,14 @@ export async function GET() {
throw new Error("settingsManager not found");
}
+ // get home dir
+ const homeDir = process.env.HOME;
+
// Load persisted settings if they exist
- const screenpipeDir = process.env.SCREENPIPE_DIR || process.cwd();
+ const screenpipeDir =
+ process.env.SCREENPIPE_DIR ||
+ (homeDir && path.join(homeDir, ".screenpipe")) ||
+ process.cwd();
const settingsPath = path.join(
screenpipeDir,
"pipes",
@@ -39,8 +45,10 @@ export async function GET() {
},
});
} catch (err) {
+ console.log("route err", err);
// If no persisted settings, return normal settings
const rawSettings = await settingsManager.getAll();
+ console.log("route rawSettings", rawSettings);
return NextResponse.json(rawSettings);
}
} catch (error) {
diff --git a/pipes/obsidian/src/lib/hooks/use-settings.tsx b/pipes/obsidian/src/lib/hooks/use-settings.tsx
index 19937b456..2598c05bf 100644
--- a/pipes/obsidian/src/lib/hooks/use-settings.tsx
+++ b/pipes/obsidian/src/lib/hooks/use-settings.tsx
@@ -47,6 +47,7 @@ if you do your job well, i'll give you a 🍺 and $1m`,
try {
const response = await fetch("/api/settings");
const data = await response.json();
+ console.log("useSettings data", data?.customSettings?.obsidian);
setSettings({ ...defaultSettings, ...data });
} catch (err) {
console.error("failed to load settings:", err);