sync pause state

This commit is contained in:
Julian Freeman
2026-03-22 15:55:06 -04:00
parent 7a82f3fb81
commit 7f9e0de193
4 changed files with 35 additions and 13 deletions

View File

@@ -2,7 +2,8 @@
import { ref, onMounted } from "vue";
import { load } from "@tauri-apps/plugin-store";
import { open } from "@tauri-apps/plugin-dialog";
import { convertFileSrc, invoke } from "@tauri-apps/api/core";
import { invoke } from "@tauri-apps/api/core";
import { listen } from "@tauri-apps/api/event";
import { FolderOpen, Settings, Play, Pause, Maximize2, X } from "lucide-vue-next";
const isSetupComplete = ref(false);
@@ -31,6 +32,11 @@ onMounted(async () => {
isPaused.value = await invoke("get_pause_state");
await loadTimeline();
}
// Listen for backend pause state changes (e.g. from tray)
await listen<boolean>("pause-state-changed", (event) => {
isPaused.value = event.payload;
});
});
const selectFolder = async () => {
@@ -79,10 +85,6 @@ const selectImage = async (img: { time: string; path: string }) => {
}
};
const getSrc = (path: string) => {
return convertFileSrc(path);
};
</script>
<template>