Skip to content

Commit

Permalink
feat: autosave timeline on view switch
Browse files Browse the repository at this point in the history
  • Loading branch information
k1nho committed Jun 26, 2024
1 parent 3efe596 commit 59d5d5a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
12 changes: 9 additions & 3 deletions frontend/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,22 @@
EventsOn,
WindowSetTitle,
} from "../wailsjs/runtime/runtime";
import { ResetTimeline } from "../wailsjs/go/main/App";
import { ResetTimeline, SaveTimeline } from "../wailsjs/go/main/App";
import { onDestroy } from "svelte";
const { route, setRoute } = router;
const { isProcessingVid } = exportOptionsStore;
const { resetVideo } = videoStore;
const { resetVideoFiles } = videoFiles;
function cleanupProjectWorkspace() {
async function cleanupProjectWorkspace() {
resetVideoFiles();
resetVideo();
ResetTimeline();
try {
await SaveTimeline();
await ResetTimeline();
} catch (err) {
console.log(err);
}
WindowSetTitle("Gahara");
}
Expand All @@ -36,6 +41,7 @@
cleanupProjectWorkspace();
break;
case "export":
SaveTimeline().catch(console.log);
WindowSetTitle(`Export - ${$projectName}`);
}
setRoute(to);
Expand Down
5 changes: 0 additions & 5 deletions frontend/src/VideoLayout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
LoadProjectFiles,
SaveTimeline,
SaveProjectFiles,
ResetTimeline,
DeleteRIDReferences,
DeleteProjectFile,
EnableVideoMenus,
Expand Down Expand Up @@ -164,10 +163,6 @@
<button
class="bg-gblue0 rounded-lg px-2 py-1 border-2 border-white flex items-center gap-2 hover:bg-gblue transition ease-in-out duration-200"
on:click={() => {
resetVideoFiles();
resetVideo();
ResetTimeline();
WindowSetTitle("Gahara");
setRoute("main");
}}
>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/VideoPlayer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
}
function handleStop() {
video.pause();
if (video) video.pause();
$currentTime = $videoNode ? $videoNode.start : 0;
}
Expand Down

0 comments on commit 59d5d5a

Please sign in to comment.