mirror of
https://github.com/NotAShelf/stash.git
synced 2026-04-17 16:19:51 +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()),
|
Some(ref m) => MimeType::Specific(m.clone()),
|
||||||
None => MimeType::Text,
|
None => MimeType::Text,
|
||||||
};
|
};
|
||||||
let _ = opts
|
let copy_result = opts
|
||||||
.copy(Source::Bytes(contents.clone().into()), mime_type);
|
.copy(Source::Bytes(contents.clone().into()), mime_type);
|
||||||
// Show notification
|
match copy_result {
|
||||||
let _ = Notification::new()
|
Ok(()) => {
|
||||||
.summary("Stash")
|
let _ = Notification::new()
|
||||||
.body("Copied entry to clipboard")
|
.summary("Stash")
|
||||||
.show();
|
.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