fix: check if action is already found before adding it to search results
This commit is contained in:
parent
8cdf308db5
commit
3a77442dbc
1 changed files with 7 additions and 5 deletions
|
|
@ -410,11 +410,13 @@ impl Search {
|
|||
.fold(
|
||||
Slab::with_capacity(self.actions.len()),
|
||||
|mut slab, (_, action)| {
|
||||
slab.insert(ShortcutModel::new(
|
||||
&self.defaults,
|
||||
&self.shortcuts,
|
||||
action.clone(),
|
||||
));
|
||||
if !slab.iter().any(|(_, model)| &model.action == action) {
|
||||
slab.insert(ShortcutModel::new(
|
||||
&self.defaults,
|
||||
&self.shortcuts,
|
||||
action.clone(),
|
||||
));
|
||||
}
|
||||
|
||||
slab
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue