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( .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
}, },