chore: update references to favorites
This commit is contained in:
parent
8858326878
commit
f453b4ef9b
3 changed files with 61 additions and 61 deletions
|
|
@ -33,21 +33,21 @@ impl Default for AppListConfig {
|
|||
}
|
||||
|
||||
impl AppListConfig {
|
||||
pub fn add_favorite(&mut self, id: String, config: &Config) {
|
||||
pub fn add_pinned(&mut self, id: String, config: &Config) {
|
||||
if !self.favorites.contains(&id) {
|
||||
self.favorites.push(id);
|
||||
let _ = self.write_entry(config);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn remove_favorite(&mut self, id: String, config: &Config) {
|
||||
pub fn remove_pinned(&mut self, id: String, config: &Config) {
|
||||
if let Some(pos) = self.favorites.iter().position(|e| e == &id) {
|
||||
self.favorites.remove(pos);
|
||||
let _ = self.write_entry(config);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn update_favorites(&mut self, favorites: Vec<String>, config: &Config) {
|
||||
pub fn update_pinned(&mut self, favorites: Vec<String>, config: &Config) {
|
||||
self.favorites = favorites;
|
||||
let _ = self.write_entry(config);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue