list: properly error notification if clipboard copy fails

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a696459d7fbc344545daeead6164cad5cde6f
This commit is contained in:
raf 2025-10-09 11:29:34 +03:00
commit d8b1ac1f37
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF

View file

@ -296,13 +296,22 @@ impl SqliteClipboardDb {
Some(ref m) => MimeType::Specific(m.clone()),
None => MimeType::Text,
};
let _ = opts
let copy_result = opts
.copy(Source::Bytes(contents.clone().into()), mime_type);
// Show notification
let _ = Notification::new()
.summary("Stash")
.body("Copied entry to clipboard")
.show();
match copy_result {
Ok(()) => {
let _ = Notification::new()
.summary("Stash")
.body("Copied entry to clipboard")
.show();
},
Err(e) => {
let _ = Notification::new()
.summary("Stash")
.body(&format!("Failed to copy entry: {e}"))
.show();
},
}
}
}
},