Skip to content

Commit

Permalink
fix build, changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
louis030195 committed Nov 8, 2024
1 parent 37e3523 commit d5c7d3d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 26 deletions.
45 changes: 23 additions & 22 deletions screenpipe-app-tauri/lib/hooks/use-changelog-dialog.tsx
Original file line number Diff line number Diff line change
@@ -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";

Expand All @@ -7,40 +13,33 @@ interface ChangelogDialogContextType {
setShowChangelogDialog: (show: boolean) => void;
}

const ChangelogDialogContext = createContext<ChangelogDialogContextType | undefined>(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<string>("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 (
<ChangelogDialogContext.Provider value={{ showChangelogDialog, setShowChangelogDialog }}>
<ChangelogDialogContext.Provider
value={{ showChangelogDialog, setShowChangelogDialog }}
>
{children}
</ChangelogDialogContext.Provider>
);
Expand All @@ -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;
};
};
2 changes: 1 addition & 1 deletion screenpipe-app-tauri/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
version = "0.9.25"
version = "0.9.26"
description = ""
authors = ["you"]
license = ""
Expand Down
4 changes: 1 addition & 3 deletions screenpipe-app-tauri/src-tauri/tauri.windows.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "./",
Expand Down

0 comments on commit d5c7d3d

Please sign in to comment.