mirror of
https://github.com/figsoda/mmtc
synced 2025-02-16 13:28:33 +00:00
only update search when needed
This commit is contained in:
parent
2e4db1b21b
commit
f47d13eb57
1 changed files with 6 additions and 2 deletions
|
@ -295,7 +295,7 @@ async fn run() -> Result<()> {
|
|||
selected = status.song.map_or(0, |song| song.pos);
|
||||
liststate = ListState::default();
|
||||
liststate.select(Some(selected));
|
||||
if searching.load(Ordering::Acquire) {
|
||||
if !query.is_empty() {
|
||||
tx.send(Command::UpdateSearch).await?;
|
||||
}
|
||||
}
|
||||
|
@ -514,7 +514,11 @@ async fn run() -> Result<()> {
|
|||
}
|
||||
Command::BackspaceSearch => {
|
||||
query.pop();
|
||||
tx.send(Command::UpdateSearch).await?;
|
||||
if query.is_empty() {
|
||||
tx.send(Command::UpdateFrame).await?;
|
||||
} else {
|
||||
tx.send(Command::UpdateSearch).await?;
|
||||
}
|
||||
}
|
||||
Command::UpdateSearch => {
|
||||
let query = query.to_lowercase();
|
||||
|
|
Loading…
Add table
Reference in a new issue