Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

style: add listener for file copied to clipboard event in initDownloadListener function

Tonhod2e6d842122b
diff --git a/src/lib/stores/download-listener.ts b/src/lib/stores/download-listener.ts
index bed02590..8d8d615d 100644
--- a/src/lib/stores/download-listener.ts
+++ b/src/lib/stores/download-listener.ts
@@ -268,6 +268,14 @@ export async function initDownloadListener(): Promise<() => void> {
},
);
+ const unlistenFileCopied = await listen<{ path: string }>(
+ "file-copied-to-clipboard",
+ () => {
+ const tr = get(t);
+ showToast("success", tr("toast.file_copied_to_clipboard"));
+ },
+ );
+
const unlistenMediaPreview = await listen<{
url: string;
title: string;
@@ -288,6 +296,7 @@ export async function initDownloadListener(): Promise<() => void> {
unlistenBatchFileStatus();
unlistenConvertProgress();
unlistenConvertComplete();
+ unlistenFileCopied();
unlistenMediaPreview();
if (throttleTimer !== null) {
clearTimeout(throttleTimer);