fix(sidebar): prevent duplicate entries of the same item
This commit is contained in:
parent
08e872a6f1
commit
e64520f727
1 changed files with 4 additions and 1 deletions
|
|
@ -1352,7 +1352,10 @@ impl Application for App {
|
|||
Message::AddToSidebar(entity_opt) => {
|
||||
let mut favorites = self.config.favorites.clone();
|
||||
for path in self.selected_paths(entity_opt) {
|
||||
favorites.push(Favorite::from_path(path));
|
||||
let favorite = Favorite::from_path(path);
|
||||
if !favorites.iter().any(|f| f == &favorite) {
|
||||
favorites.push(favorite);
|
||||
}
|
||||
}
|
||||
config_set!(favorites, favorites);
|
||||
return self.update_config();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue