refactor(ui): Simplified the popup delegation so all future UI is easier to implement
This commit is contained in:
@@ -2102,12 +2102,16 @@ impl<'a, 'b> Network<'a, 'b> {
|
||||
self
|
||||
.handle_request::<Value, Value>(request_props, |test_results, mut app| {
|
||||
if test_results.as_object().is_none() {
|
||||
app.data.radarr_data.indexer_test_error = Some(
|
||||
test_results.as_array().unwrap()[0]
|
||||
app.data.radarr_data.indexer_test_errors = Some(
|
||||
test_results
|
||||
.as_array()
|
||||
.unwrap()[0]
|
||||
.get("errorMessage")
|
||||
.unwrap()
|
||||
.to_string(),
|
||||
.to_string()
|
||||
);
|
||||
} else {
|
||||
app.data.radarr_data.indexer_test_errors = Some(String::new());
|
||||
};
|
||||
})
|
||||
.await
|
||||
|
||||
@@ -931,7 +931,7 @@ mod test {
|
||||
async_details_server.assert_async().await;
|
||||
async_test_server.assert_async().await;
|
||||
assert_eq!(
|
||||
app_arc.lock().await.data.radarr_data.indexer_test_error,
|
||||
app_arc.lock().await.data.radarr_data.indexer_test_errors,
|
||||
Some("\"test failure\"".to_owned())
|
||||
);
|
||||
assert_eq!(value, response_json)
|
||||
@@ -1000,8 +1000,8 @@ mod test {
|
||||
async_details_server.assert_async().await;
|
||||
async_test_server.assert_async().await;
|
||||
assert_eq!(
|
||||
app_arc.lock().await.data.radarr_data.indexer_test_error,
|
||||
None
|
||||
app_arc.lock().await.data.radarr_data.indexer_test_errors,
|
||||
Some(String::new())
|
||||
);
|
||||
assert_eq!(value, json!({}));
|
||||
}
|
||||
|
||||
@@ -2368,12 +2368,14 @@ impl<'a, 'b> Network<'a, 'b> {
|
||||
self
|
||||
.handle_request::<Value, Value>(request_props, |test_results, mut app| {
|
||||
if test_results.as_object().is_none() {
|
||||
app.data.sonarr_data.indexer_test_error = Some(
|
||||
app.data.sonarr_data.indexer_test_errors = Some(
|
||||
test_results.as_array().unwrap()[0]
|
||||
.get("errorMessage")
|
||||
.unwrap()
|
||||
.to_string(),
|
||||
);
|
||||
} else {
|
||||
app.data.sonarr_data.indexer_test_errors = Some(String::new());
|
||||
};
|
||||
})
|
||||
.await
|
||||
|
||||
@@ -6302,7 +6302,7 @@ mod test {
|
||||
async_details_server.assert_async().await;
|
||||
async_test_server.assert_async().await;
|
||||
assert_eq!(
|
||||
app_arc.lock().await.data.sonarr_data.indexer_test_error,
|
||||
app_arc.lock().await.data.sonarr_data.indexer_test_errors,
|
||||
Some("\"test failure\"".to_owned())
|
||||
);
|
||||
assert_eq!(value, response_json)
|
||||
@@ -6371,8 +6371,8 @@ mod test {
|
||||
async_details_server.assert_async().await;
|
||||
async_test_server.assert_async().await;
|
||||
assert_eq!(
|
||||
app_arc.lock().await.data.sonarr_data.indexer_test_error,
|
||||
None
|
||||
app_arc.lock().await.data.sonarr_data.indexer_test_errors,
|
||||
Some(String::new())
|
||||
);
|
||||
assert_eq!(value, json!({}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user