trying to fix bug

This commit is contained in:
2026-04-09 01:36:28 -06:00
parent f9cd2bf579
commit 1d17a8f19a
10 changed files with 133 additions and 27 deletions

View File

@ -23,6 +23,7 @@ import {
} from 'lucide-react';
const IS_ELECTRON = !!window.electronAPI;
const LAST_MEDIA_PATH_KEY = 'talkedit:lastMediaPath';
type Panel = 'ai' | 'settings' | 'export' | 'silence' | null;
@ -74,6 +75,23 @@ export default function App() {
// The backend URL is fixed at 127.0.0.1:8000 so we rely on the store default.
}, [setBackendUrl]);
useEffect(() => {
if (!IS_ELECTRON || videoPath) return;
const savedPath = sessionStorage.getItem(LAST_MEDIA_PATH_KEY);
if (savedPath) {
loadVideo(savedPath);
}
}, [videoPath, loadVideo]);
useEffect(() => {
if (!IS_ELECTRON) return;
if (videoPath) {
sessionStorage.setItem(LAST_MEDIA_PATH_KEY, videoPath);
return;
}
sessionStorage.removeItem(LAST_MEDIA_PATH_KEY);
}, [videoPath]);
const handleLoadProject = async () => {
if (!IS_ELECTRON) return;
try {