refactor(movie_details_handler): Use the new handle_table_events macro

This commit is contained in:
2024-12-08 14:04:34 -07:00
parent f1d934b0a6
commit d6863dc1fd
4 changed files with 84 additions and 224 deletions
+3 -2
View File
@@ -216,9 +216,10 @@ macro_rules! handle_table_events {
_ if props.sorting_block.is_some()
&& $self.app.get_current_route() == *props.sorting_block.as_ref().unwrap() =>
{
let sort_by_fn = props.sort_by_fn.expect("Sort by function is required");
if let Some(sort_by_fn) = props.sort_by_fn {
$table.items.sort_by(sort_by_fn);
}
$table.items.sort_by(sort_by_fn);
$table.apply_sorting();
$self.app.pop_navigation_stack();