Move share command handling completely to ListView

This commit is contained in:
Rasmus Larsen
2019-05-10 12:55:22 +02:00
parent 90c1930c39
commit 224597ae92
2 changed files with 16 additions and 36 deletions

View File

@@ -198,25 +198,6 @@ impl CommandManager {
);
}
{
let queue = queue.clone();
self.register_command(
"share",
Some(Box::new(move |_, args| {
if let Some(url) = args.get(0).and_then(|source| match source.as_str() {
"current" => queue.get_current().and_then(|t| t.share_url()),
_ => None,
}) {
ClipboardProvider::new()
.and_then(|mut ctx: ClipboardContext| ctx.set_contents(url))
.unwrap();
}
Ok(None)
})),
)
}
{
let spotify = spotify.clone();
self.register_command(