mirror of
https://github.com/NotAShelf/stash.git
synced 2026-04-12 22:17:41 +00:00
list: properly error notification if clipboard copy fails
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I6a6a696459d7fbc344545daeead6164cad5cde6f
This commit is contained in:
parent
4c0782f80e
commit
d8b1ac1f37
1 changed files with 15 additions and 6 deletions
|
|
@ -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();
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue