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: status etc

Louis Beaumont620ef7c1273a
diff --git a/screenpipe-app-tauri/components/onboarding.tsx b/screenpipe-app-tauri/components/onboarding.tsx
index db4e00b73..eda81f0c8 100644
--- a/screenpipe-app-tauri/components/onboarding.tsx
+++ b/screenpipe-app-tauri/components/onboarding.tsx
@@ -156,15 +156,7 @@ const Onboarding: React.FC = () => {
}
}, [showOnboarding]);
- useEffect(() => {
- const checkFirstTimeUser = async () => {
- const isFirstTime = await localforage.getItem<boolean>("isFirstTimeUser");
- if (isFirstTime === null) {
- setShowOnboarding(true);
- }
- };
- checkFirstTimeUser();
- }, []);
+
useEffect(() => {
if (error) {
diff --git a/screenpipe-app-tauri/components/onboarding/api-setup.tsx b/screenpipe-app-tauri/components/onboarding/api-setup.tsx
index ed7070d30..2c32225a4 100644
--- a/screenpipe-app-tauri/components/onboarding/api-setup.tsx
+++ b/screenpipe-app-tauri/components/onboarding/api-setup.tsx
@@ -54,8 +54,12 @@ const OnboardingAPISetup: React.FC<OnboardingAPISetupProps> = ({
useEffect(() => {
const { aiUrl, openaiApiKey, aiModel } = localSettings;
+ const isApiKeyRequired = aiUrl !== "https://ai-proxy.i-f9f.workers.dev/v1" && aiUrl !== "http://localhost:11434/v1";
+
setAreAllInputsFilled(
- aiUrl.trim() !== "" && openaiApiKey.trim() !== "" && aiModel.trim() !== ""
+ aiUrl.trim() !== "" &&
+ aiModel.trim() !== "" &&
+ (!isApiKeyRequired || openaiApiKey.trim() !== "")
);
}, [localSettings]);
diff --git a/screenpipe-app-tauri/components/screenpipe-status.tsx b/screenpipe-app-tauri/components/screenpipe-status.tsx
index b4088fac4..9bd313fbe 100644
--- a/screenpipe-app-tauri/components/screenpipe-status.tsx
+++ b/screenpipe-app-tauri/components/screenpipe-status.tsx
@@ -134,6 +134,7 @@ const DevModeSettings = () => {
};
const [isLoading, setIsLoading] = useState(false);
const { toast } = useToast();
+ const { forceRestartHealthCheck } = useHealthCheck();
useEffect(() => {
setLocalSettings(settings);
@@ -149,6 +150,7 @@ const DevModeSettings = () => {
try {
await invoke("spawn_screenpipe");
await new Promise((resolve) => setTimeout(resolve, 2000));
+ forceRestartHealthCheck(); // Add this line
toastId.update({
id: toastId.id,
title: "screenpipe started",
@@ -180,6 +182,7 @@ const DevModeSettings = () => {
try {
await invoke("kill_all_sreenpipes");
await new Promise((resolve) => setTimeout(resolve, 2000));
+ forceRestartHealthCheck(); // Add this line
toastId.update({
id: toastId.id,
title: "screenpipe stopped",
diff --git a/screenpipe-app-tauri/lib/hooks/use-health-check.tsx b/screenpipe-app-tauri/lib/hooks/use-health-check.tsx
index e5115216d..7539b5266 100644
--- a/screenpipe-app-tauri/lib/hooks/use-health-check.tsx
+++ b/screenpipe-app-tauri/lib/hooks/use-health-check.tsx
@@ -1,4 +1,4 @@
-import { useState, useEffect } from "react";
+import { useState, useEffect, useCallback } from "react";
interface HealthCheckResponse {
status: string;
@@ -15,8 +15,9 @@ export function useHealthCheck() {
const [isServerDown, setIsServerDown] = useState(false);
const baseCheckInterval = 5000; // 5 seconds
const maxCheckInterval = 60000; // 1 minute
+ const [restartKey, setRestartKey] = useState(0);
- const fetchHealth = async () => {
+ const fetchHealth = useCallback(async () => {
try {
const response = await fetch("http://localhost:3030/health");
if (!response.ok) {
@@ -46,7 +47,11 @@ export function useHealthCheck() {
});
}
}
- };
+ }, [health, isServerDown]);
+
+ const forceRestartHealthCheck = useCallback(() => {
+ setRestartKey((prevKey) => prevKey + 1);
+ }, []);
useEffect(() => {
fetchHealth();
@@ -58,7 +63,7 @@ export function useHealthCheck() {
);
return () => clearInterval(interval);
- }, [isServerDown]);
+ }, [isServerDown, fetchHealth, restartKey]);
- return { health, isServerDown };
+ return { health, isServerDown, forceRestartHealthCheck };
}
diff --git a/screenpipe-app-tauri/lib/hooks/use-onboarding.tsx b/screenpipe-app-tauri/lib/hooks/use-onboarding.tsx
index 3e1e149b5..49af0b85c 100644
--- a/screenpipe-app-tauri/lib/hooks/use-onboarding.tsx
+++ b/screenpipe-app-tauri/lib/hooks/use-onboarding.tsx
@@ -1,4 +1,5 @@
-import React, { createContext, useState, useContext } from "react";
+import localforage from "localforage";
+import React, { createContext, useState, useContext, useEffect } from "react";
interface OnboardingContextType {
showOnboarding: boolean;
@@ -13,7 +14,17 @@ export const OnboardingProvider: React.FC<{ children: React.ReactNode }> = ({
children,
}) => {
const [showOnboarding, setShowOnboarding] = useState(false);
-
+ useEffect(() => {
+ const checkFirstTimeUser = async () => {
+ const isFirstTime = await localforage.getItem<boolean>("isFirstTimeUser");
+ console.log("isFirstTime", isFirstTime);
+ if (isFirstTime === null) {
+ setShowOnboarding(true);
+ }
+ };
+ console.log("checkFirstTimeUser");
+ checkFirstTimeUser();
+ }, []);
return (
<OnboardingContext.Provider value={{ showOnboarding, setShowOnboarding }}>
{children}
diff --git a/screenpipe-app-tauri/src-tauri/Cargo.toml b/screenpipe-app-tauri/src-tauri/Cargo.toml
index 190e87cc9..60ef5278c 100644
--- a/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "0.5.7"
+version = "0.5.8"
description = ""
authors = ["you"]
license = ""