fix: check if action is already found before adding it to search results

This commit is contained in:
Ashley Wulber 2026-06-05 14:08:19 -04:00 committed by Ashley Wulber
parent 8cdf308db5
commit 3a77442dbc

View file

@ -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
},