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

fix(app): day picker uses apiBase + optimistic UI update

Louis Beaumontf96f9df5bb4e
diff --git a/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx b/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx
index 9acba6767..ffc2ebdb7 100644
--- a/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx
@@ -1942,9 +1942,15 @@ export function PipesSection() {
} else {
newSchedule = [...baseParts, "*"].join(" ");
}
- // Save
const pipeName = pipe.config.name;
- fetch(`http://localhost:3030/pipes/${pipeName}/config`, {
+ setPipes((prev) =>
+ prev.map((p) =>
+ p.config.name === pipeName
+ ? { ...p, config: { ...p.config, schedule: newSchedule } }
+ : p
+ )
+ );
+ fetch(`${apiBase}/pipes/${pipeName}/config`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ schedule: newSchedule }),
@@ -1977,7 +1983,14 @@ export function PipesSection() {
}
const newSchedule = [...baseParts, dowStr].join(" ");
const pipeName = pipe.config.name;
- fetch(`http://localhost:3030/pipes/${pipeName}/config`, {
+ setPipes((prev) =>
+ prev.map((p) =>
+ p.config.name === pipeName
+ ? { ...p, config: { ...p.config, schedule: newSchedule } }
+ : p
+ )
+ );
+ fetch(`${apiBase}/pipes/${pipeName}/config`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ schedule: newSchedule }),