fix: When adding a film from the Collection Details modal, the render order was wrong: Radarr Library -> Collection Table -> Add Movie Prompt (missing the Collection details prompt too). Correct order is: Collection Table -> Collection Details Modal -> Add Movie Modal
This commit is contained in:
@@ -33,7 +33,7 @@ impl DrawUi for CollectionDetailsUi {
|
|||||||
if let Route::Radarr(active_radarr_block, context_option) = route {
|
if let Route::Radarr(active_radarr_block, context_option) = route {
|
||||||
if let Some(context) = context_option {
|
if let Some(context) = context_option {
|
||||||
return COLLECTION_DETAILS_BLOCKS.contains(&active_radarr_block)
|
return COLLECTION_DETAILS_BLOCKS.contains(&active_radarr_block)
|
||||||
&& context == ActiveRadarrBlock::CollectionDetails;
|
|| context == ActiveRadarrBlock::CollectionDetails;
|
||||||
}
|
}
|
||||||
|
|
||||||
return COLLECTION_DETAILS_BLOCKS.contains(&active_radarr_block);
|
return COLLECTION_DETAILS_BLOCKS.contains(&active_radarr_block);
|
||||||
|
|||||||
@@ -25,5 +25,12 @@ mod tests {
|
|||||||
)
|
)
|
||||||
.into()
|
.into()
|
||||||
));
|
));
|
||||||
|
assert!(CollectionDetailsUi::accepts(
|
||||||
|
(
|
||||||
|
ActiveRadarrBlock::AddMoviePrompt,
|
||||||
|
Some(ActiveRadarrBlock::CollectionDetails)
|
||||||
|
)
|
||||||
|
.into()
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,12 @@ impl DrawUi for LibraryUi {
|
|||||||
|
|
||||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||||
let route = app.get_current_route();
|
let route = app.get_current_route();
|
||||||
|
if let Route::Radarr(_, context_option) = route {
|
||||||
|
if context_option.is_some() && AddMovieUi::accepts(route) {
|
||||||
|
AddMovieUi::draw(f, app, area);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
draw_library(f, app, area);
|
draw_library(f, app, area);
|
||||||
|
|
||||||
match route {
|
match route {
|
||||||
@@ -65,6 +71,7 @@ impl DrawUi for LibraryUi {
|
|||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn draw_library(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
fn draw_library(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||||
|
|||||||
Reference in New Issue
Block a user