From d5c7d3d1451a803e830832728a14a8260b5eff4f Mon Sep 17 00:00:00 2001 From: Louis Beaumont Date: Fri, 8 Nov 2024 10:05:24 -0800 Subject: [PATCH] fix build, changelog --- .../lib/hooks/use-changelog-dialog.tsx | 45 ++++++++++--------- screenpipe-app-tauri/src-tauri/Cargo.toml | 2 +- .../src-tauri/tauri.windows.conf.json | 4 +- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/screenpipe-app-tauri/lib/hooks/use-changelog-dialog.tsx b/screenpipe-app-tauri/lib/hooks/use-changelog-dialog.tsx index 96913663d..099d5f304 100644 --- a/screenpipe-app-tauri/lib/hooks/use-changelog-dialog.tsx +++ b/screenpipe-app-tauri/lib/hooks/use-changelog-dialog.tsx @@ -1,4 +1,10 @@ -import React, { createContext, useContext, useState, useEffect, useRef, ReactNode } from "react"; +import React, { + createContext, + useContext, + useState, + useEffect, + ReactNode, +} from "react"; import localforage from "localforage"; import { useAppVersion } from "./use-app-version"; @@ -7,40 +13,33 @@ interface ChangelogDialogContextType { setShowChangelogDialog: (show: boolean) => void; } -const ChangelogDialogContext = createContext(undefined); +const ChangelogDialogContext = createContext< + ChangelogDialogContextType | undefined +>(undefined); -export const ChangelogDialogProvider: React.FC<{ children: ReactNode }> = ({ children }) => { +export const ChangelogDialogProvider: React.FC<{ children: ReactNode }> = ({ + children, +}) => { const [showChangelogDialog, setShowChangelogDialog] = useState(false); - const hasMounted = useRef(false); const version = useAppVersion(); useEffect(() => { const checkChangelogStatus = async () => { const versionSeen = await localforage.getItem("versionSeen"); - if (versionSeen === undefined || versionSeen !== version) { + if (version && (!versionSeen || versionSeen !== version)) { setShowChangelogDialog(true); + await localforage.setItem("versionSeen", version); } }; + checkChangelogStatus(); }, [version]); - useEffect(() => { - if (hasMounted.current) { - const setCurrentVersion = async () => { - await localforage.setItem("versionSeen", version); - }; - - if (!showChangelogDialog) { - setCurrentVersion(); - } - } else { - hasMounted.current = true; - } - }, [showChangelogDialog, version]); - return ( - + {children} ); @@ -49,7 +48,9 @@ export const ChangelogDialogProvider: React.FC<{ children: ReactNode }> = ({ chi export const useChangelogDialog = (): ChangelogDialogContextType => { const context = useContext(ChangelogDialogContext); if (context === undefined) { - throw new Error("useChangelogDialog must be used within a ChangelogDialogProvider"); + throw new Error( + "useChangelogDialog must be used within a ChangelogDialogProvider" + ); } return context; -}; \ No newline at end of file +}; diff --git a/screenpipe-app-tauri/src-tauri/Cargo.toml b/screenpipe-app-tauri/src-tauri/Cargo.toml index 8687029b8..c1affba6d 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.9.25" +version = "0.9.26" description = "" authors = ["you"] license = "" diff --git a/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json b/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json index 0cb2bd2b9..aa9cfeeac 100644 --- a/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json +++ b/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json @@ -6,9 +6,7 @@ "ollama" ], "resources": { - "ffmpeg\\bin\\ffmpeg.exe": "./", - "ffmpeg\\bin\\ffprobe.exe": "./", - "ffmpeg\\bin\\*.dll": "./", + "ffmpeg\\bin\\x64\\*": "./", "ffmpeg\\lib\\*": "./", "onnxruntime*\\lib\\onnxruntime.dll": "./", "onnxruntime*\\lib\\onnxruntime_providers_cuda.dll": "./",