Did a lot of things in this one: Cleaned up a bit of leftover unused code from yesterday; deprecated the use of drain() on HorizontallyScrollableText; Refactored the uses of search and filter to be wrapped in Options; Fixed a race condition when closing the Add Movie modals in rapid succession; upgraded to ratatui 0.22.0; Fixed a bug in attempting to close an empty root folder; fixed a bug in attempting to close an empty filter; fixed a bug in attempting to close an empty search; fixed a bug in attempting to close an empty filter without resetting the view; fixed a bug in attempting to delete a movie after dynamically added one and updating the main library table
This commit is contained in:
@@ -124,8 +124,15 @@ fn draw_add_movie_search<B: Backend>(f: &mut Frame<'_, B>, app: &mut App<'_>, ar
|
||||
area,
|
||||
1,
|
||||
);
|
||||
let block_content = &app.data.radarr_data.search.text;
|
||||
let offset = *app.data.radarr_data.search.offset.borrow();
|
||||
let block_content = &app.data.radarr_data.search.as_ref().unwrap().text;
|
||||
let offset = *app
|
||||
.data
|
||||
.radarr_data
|
||||
.search
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow();
|
||||
|
||||
if let Route::Radarr(active_radarr_block, _) = *app.get_current_route() {
|
||||
match active_radarr_block {
|
||||
|
||||
+18
-4
@@ -254,8 +254,15 @@ fn draw_search_box<B: Backend>(f: &mut Frame<'_, B>, app: &mut App<'_>, area: Re
|
||||
Route::Radarr(active_radarr_block, _) => match active_radarr_block {
|
||||
_ if SEARCH_BLOCKS.contains(active_radarr_block) => (
|
||||
"Search",
|
||||
*app.data.radarr_data.search.offset.borrow(),
|
||||
&app.data.radarr_data.search.text,
|
||||
*app
|
||||
.data
|
||||
.radarr_data
|
||||
.search
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
&app.data.radarr_data.search.as_ref().unwrap().text,
|
||||
),
|
||||
_ => ("", 0, &default_content),
|
||||
},
|
||||
@@ -295,8 +302,15 @@ fn draw_filter_box<B: Backend>(f: &mut Frame<'_, B>, app: &mut App<'_>, area: Re
|
||||
Route::Radarr(active_radarr_block, _) => match active_radarr_block {
|
||||
_ if FILTER_BLOCKS.contains(active_radarr_block) => (
|
||||
"Filter",
|
||||
*app.data.radarr_data.filter.offset.borrow(),
|
||||
&app.data.radarr_data.filter.text,
|
||||
*app
|
||||
.data
|
||||
.radarr_data
|
||||
.filter
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
&app.data.radarr_data.filter.as_ref().unwrap().text,
|
||||
),
|
||||
_ => ("", 0, &default_content),
|
||||
},
|
||||
|
||||
@@ -119,8 +119,15 @@ fn draw_add_root_folder_prompt_box<B: Backend>(
|
||||
1,
|
||||
);
|
||||
let block_title = "Add Root Folder";
|
||||
let offset = *app.data.radarr_data.edit_path.offset.borrow();
|
||||
let block_content = &app.data.radarr_data.edit_path.text;
|
||||
let offset = *app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_root_folder
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow();
|
||||
let block_content = &app.data.radarr_data.edit_root_folder.as_ref().unwrap().text;
|
||||
|
||||
let input = Paragraph::new(block_content.as_str())
|
||||
.style(style_default())
|
||||
|
||||
Reference in New Issue
Block a user