fix: unused listener for live update

This commit is contained in:
PandaDEV 2024-12-12 17:09:57 +10:00
parent 46fe44071d
commit e5597050a9
No known key found for this signature in database
GPG key ID: 13EFF9BAF70EE75C

View file

@ -111,7 +111,6 @@ pub fn setup<R: Runtime>(app: &AppHandle<R>) {
HistoryItem::new(ContentType::Image, file_path, None), HistoryItem::new(ContentType::Image, file_path, None),
).await; ).await;
} }
let _ = app.emit("plugin:clipboard://image-changed", ());
} else if available_types.files { } else if available_types.files {
println!("Handling files change"); println!("Handling files change");
if let Ok(files) = clipboard.read_files() { if let Ok(files) = clipboard.read_files() {
@ -121,7 +120,6 @@ pub fn setup<R: Runtime>(app: &AppHandle<R>) {
HistoryItem::new(ContentType::File, files_str, None), HistoryItem::new(ContentType::File, files_str, None),
).await; ).await;
} }
let _ = app.emit("plugin:clipboard://files-changed", ());
} else if available_types.text { } else if available_types.text {
println!("Handling text change"); println!("Handling text change");
if let Ok(text) = clipboard.read_text() { if let Ok(text) = clipboard.read_text() {
@ -149,7 +147,6 @@ pub fn setup<R: Runtime>(app: &AppHandle<R>) {
).await; ).await;
} }
} }
let _ = app.emit("plugin:clipboard://text-changed", ());
} else { } else {
println!("Unknown clipboard content type"); println!("Unknown clipboard content type");
} }
@ -158,6 +155,8 @@ pub fn setup<R: Runtime>(app: &AppHandle<R>) {
println!("Failed to get database pool: {}", e); println!("Failed to get database pool: {}", e);
} }
} }
let _ = app.emit("clipboard-content-updated", ());
}); });
}, },
); );