Fixed duplicated bookmarks after overwrite

This commit is contained in:
ChristianVisintin
2021-03-08 17:04:32 +01:00
committed by veeso
parent 7a5861f32f
commit 88a014807f
2 changed files with 3 additions and 0 deletions

View File

@@ -94,6 +94,8 @@ impl AuthActivity {
bookmarks_cli.add_bookmark(name.clone(), address, port, protocol, username, password);
// Save bookmarks
self.write_bookmarks();
// Remove `name` from bookmarks if exists
self.bookmarks_list.retain(|b| b.as_str() != name.as_str());
// Push bookmark to list and sort
self.bookmarks_list.push(name);
self.sort_bookmarks();