refactor(ui): Simplified the popup delegation so all future UI is easier to implement
This commit is contained in:
@@ -31,8 +31,9 @@ impl DrawUi for DownloadsUi {
|
||||
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
if let Route::Sonarr(active_sonarr_block, _) = app.get_current_route() {
|
||||
draw_downloads(f, app, area);
|
||||
|
||||
match active_sonarr_block {
|
||||
ActiveSonarrBlock::Downloads => draw_downloads(f, app, area),
|
||||
ActiveSonarrBlock::DeleteDownloadPrompt => {
|
||||
let prompt = format!(
|
||||
"Do you really want to delete this download: \n{}?",
|
||||
@@ -43,7 +44,6 @@ impl DrawUi for DownloadsUi {
|
||||
.prompt(&prompt)
|
||||
.yes_no_value(app.data.sonarr_data.prompt_confirm);
|
||||
|
||||
draw_downloads(f, app, area);
|
||||
f.render_widget(
|
||||
Popup::new(confirmation_prompt).size(Size::MediumPrompt),
|
||||
f.area(),
|
||||
@@ -55,7 +55,6 @@ impl DrawUi for DownloadsUi {
|
||||
.prompt("Do you want to update your downloads?")
|
||||
.yes_no_value(app.data.sonarr_data.prompt_confirm);
|
||||
|
||||
draw_downloads(f, app, area);
|
||||
f.render_widget(
|
||||
Popup::new(confirmation_prompt).size(Size::MediumPrompt),
|
||||
f.area(),
|
||||
|
||||
Reference in New Issue
Block a user