Skip to content

Commit

Permalink
refactor: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lautarodragan committed Feb 3, 2025
1 parent 07112cf commit 92b110a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/components/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ mod keyboard_handler;
mod library;
mod widget;

pub use album_tree_item::*;
pub use library::*;
5 changes: 1 addition & 4 deletions src/components/library/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use crate::{
components::{FocusGroup, List, Tree, TreeNode},
config::Theme,
structs::{Direction, Song},
toml::{get_config_file_path, TomlFileError},
ui::{Component, Focusable},
};

Expand All @@ -30,8 +29,6 @@ impl<'a> Library<'a> {
pub fn new(theme: Theme) -> Self {
let album_tree_items = load_lib();

log::debug!("{album_tree_items:#?}");

let on_select_songs_fn: Rc<RefCell<Box<dyn FnMut(Vec<&Song>) + 'a>>> = Rc::new(RefCell::new(Box::new(|_| {})));

let mut song_list = List::new(
Expand Down Expand Up @@ -161,7 +158,7 @@ impl<'a> Library<'a> {
}
}

save_lib(&artist_nodes);
save_lib(artist_nodes);
});
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/components/tree/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,9 @@ where
for node in &mut *nodes {
node.is_open = false;
}

// TODO: if the selected node was closed, `selected_path = selected_path.parent()`
// and update the scroll position if necessary
}
_ => {}
}
Expand Down

0 comments on commit 92b110a

Please sign in to comment.