Skip to content

Commit

Permalink
fix: retain selection when launching recents (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
goweiwen committed Oct 23, 2023
1 parent 69909bc commit 4de6ae6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion allium-launcher/src/view/entry_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ where
.entries(&self.res.get(), &self.res.get(), &self.res.get())?;
self.list.set_items(
self.entries.iter().map(|e| e.name().to_string()).collect(),
false,
true,
);
Ok(())
}
Expand Down
5 changes: 1 addition & 4 deletions allium-launcher/src/view/recents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ impl Recents {

pub fn load_or_new(rect: Rect, res: Resources, state: Option<RecentsState>) -> Result<Self> {
let list = if let Some(state) = state {
let selected = state.selected;
let mut list = EntryList::load(rect, res.clone(), state)?;
list.select(selected);
list
EntryList::load(rect, res.clone(), state)?
} else {
EntryList::new(rect, res.clone(), RecentsSort::LastPlayed)?
};
Expand Down

0 comments on commit 4de6ae6

Please sign in to comment.