feat: shorten the alert on trashing/deleting

This commit is contained in:
sxyazi 2023-09-09 15:44:24 +08:00
parent c40058ebfa
commit ff42685ec9
No known key found for this signature in database

View File

@ -182,11 +182,11 @@ impl Tasks {
pub fn file_remove(&self, targets: Vec<Url>, permanently: bool) -> bool {
let scheduler = self.scheduler.clone();
tokio::spawn(async move {
let s = if targets.len() > 1 { 's' } else { ' ' };
let s = if targets.len() > 1 { "s" } else { "" };
let result = emit!(Input(InputOpt::hovered(if permanently {
format!("Sure to delete selected file{s} permanently? (y/N)")
format!("Delete selected file{s} permanently? (y/N)")
} else {
format!("Sure to move selected file{s} to trash? (y/N)")
format!("Move selected file{s} to trash? (y/N)")
})));
if let Ok(choice) = result.await {