sync pause state
This commit is contained in:
12
src/App.vue
12
src/App.vue
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user