diff --git a/examples/apps/screenpipe-app-tauri/app/page.tsx b/examples/apps/screenpipe-app-tauri/app/page.tsx index 13e9ee097..4bdd891b3 100644 --- a/examples/apps/screenpipe-app-tauri/app/page.tsx +++ b/examples/apps/screenpipe-app-tauri/app/page.tsx @@ -40,7 +40,6 @@ export default function Home() { return (
- {/* */} {/* */} {/* */} diff --git a/examples/apps/screenpipe-app-tauri/components/pipe-store.tsx b/examples/apps/screenpipe-app-tauri/components/pipe-store.tsx index b3c505293..9a84c24b8 100644 --- a/examples/apps/screenpipe-app-tauri/components/pipe-store.tsx +++ b/examples/apps/screenpipe-app-tauri/components/pipe-store.tsx @@ -91,6 +91,7 @@ const PipeDialog: React.FC = () => { // Update installed pipes in settings const updatedInstalledPipes = [...settings.installedPipes, pipe]; + console.log("updated installed pipes", updatedInstalledPipes); await updateSettings({ installedPipes: updatedInstalledPipes }); // Kill existing screenpipe processes @@ -99,6 +100,8 @@ const PipeDialog: React.FC = () => { // Spawn new screenpipe process with the pipe await invoke("spawn_screenpipe"); + await new Promise((resolve) => setTimeout(resolve, 1000)); + toast({ title: "Pipe installed successfully", description: "Screenpipe has been restarted with the new pipe.", @@ -126,11 +129,13 @@ const PipeDialog: React.FC = () => { const updatedInstalledPipes = settings.installedPipes.filter( (p) => p.name !== pipe.name ); + console.log("updated installed pipes", updatedInstalledPipes); await updateSettings({ installedPipes: updatedInstalledPipes }); // restart screenpipe with no pipe await invoke("kill_all_sreenpipes"); await invoke("spawn_screenpipe"); + await new Promise((resolve) => setTimeout(resolve, 1000)); toast({ title: "Pipe uninstalled successfully", @@ -221,67 +226,60 @@ const PipeDialog: React.FC = () => { - {isInstalled ? ( -
-

Controls

- {/* Add controls for the installed pipe here */} -

Pipe controls will be displayed here.

-
- ) : ( -
-

About this pipe

- {children}

; - }, - code({ node, className, children, ...props }) { - const content = String(children).replace(/\n$/, ""); - const match = /language-(\w+)/.exec(className || ""); - if (!match) { - return ( - - {content} - - ); - } +
+

About this pipe

+ {children}

; + }, + code({ node, className, children, ...props }) { + const content = String(children).replace(/\n$/, ""); + const match = /language-(\w+)/.exec(className || ""); + if (!match) { return ( - - ); - }, - img({ src, alt }) { - return ( - /* eslint-disable @next/next/no-img-element */ - {alt} { - const target = e.target as HTMLImageElement; - target.onerror = null; - target.src = "path/to/fallback/image.png"; // Replace with your fallback image - }} - /> + > + {content} + ); - }, - }} - > - {selectedPipe.fullDescription.replace(/Â/g, "")} -
-
- )} + } + + return ( + + ); + }, + img({ src, alt }) { + return ( + /* eslint-disable @next/next/no-img-element */ + {alt} { + const target = e.target as HTMLImageElement; + target.onerror = null; + target.src = "path/to/fallback/image.png"; // Replace with your fallback image + }} + /> + ); + }, + }} + > + {selectedPipe.fullDescription.replace(/Â/g, "")} +
+
); }; diff --git a/examples/apps/screenpipe-app-tauri/components/screenpipe-status.tsx b/examples/apps/screenpipe-app-tauri/components/screenpipe-status.tsx index f4ea27196..75e23fc04 100644 --- a/examples/apps/screenpipe-app-tauri/components/screenpipe-status.tsx +++ b/examples/apps/screenpipe-app-tauri/components/screenpipe-status.tsx @@ -25,6 +25,7 @@ import { Button } from "./ui/button"; import { Separator } from "./ui/separator"; import { Card, CardContent, CardFooter } from "./ui/card"; import { useHealthCheck } from "@/lib/hooks/use-health-check"; +import { DevSettings } from "./dev-dialog"; const getDebuggingCommands = (os: string | null) => { let cliInstructions = ""; @@ -309,6 +310,7 @@ const DevModeSettings = () => { and ask ChatGPT for curl commands to interact with the API.

+ )} diff --git a/examples/apps/screenpipe-app-tauri/src-tauri/src/main.rs b/examples/apps/screenpipe-app-tauri/src-tauri/src/main.rs index 31e144356..919686fb1 100755 --- a/examples/apps/screenpipe-app-tauri/src-tauri/src/main.rs +++ b/examples/apps/screenpipe-app-tauri/src-tauri/src/main.rs @@ -183,7 +183,9 @@ fn spawn_sidecar(app: &tauri::AppHandle) -> Result { .map(|arr| arr.to_vec())) }) .map_err(|e| e.to_string())? - .unwrap_or_default(); +.unwrap_or_default(); + + debug!("pipes: {:?}", pipes); let port = with_store(app.clone(), stores.clone(), path.clone(), |store| { Ok(store .get("port") @@ -250,13 +252,16 @@ fn spawn_sidecar(app: &tauri::AppHandle) -> Result { } if !pipes.is_empty() { + info!("adding pipes: {:?}", pipes); let mut added_pipes = std::collections::HashSet::new(); for pipe in &pipes { - if let Some(pipe_str) = pipe.as_str() { - if added_pipes.insert(pipe_str) { - args.push("--pipe"); - args.push(pipe_str); - info!("adding pipe: {}", pipe_str); + if let Some(obj) = pipe.as_object() { + if let Some(main_file) = obj.get("mainFile").and_then(Value::as_str) { + if added_pipes.insert(main_file) { + args.push("--pipe"); + args.push(main_file); + info!("adding pipe: {}", main_file); + } } } }