trying to fix bug
This commit is contained in:
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user