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(
|
.fold(
|
||||||
Slab::with_capacity(self.actions.len()),
|
Slab::with_capacity(self.actions.len()),
|
||||||
|mut slab, (_, action)| {
|
|mut slab, (_, action)| {
|
||||||
slab.insert(ShortcutModel::new(
|
if !slab.iter().any(|(_, model)| &model.action == action) {
|
||||||
&self.defaults,
|
slab.insert(ShortcutModel::new(
|
||||||
&self.shortcuts,
|
&self.defaults,
|
||||||
action.clone(),
|
&self.shortcuts,
|
||||||
));
|
action.clone(),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
slab
|
slab
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue