fix: 404 when returning to collections dashboard (#5963)
* fix 404 when returning to collections dashboard, fix a couple hydration issues * fix clippy * fmt * fix hydration issue on revenue page * fix transfer history page error --------- Co-authored-by: aecsocket <aecsocket@tutanota.com>
This commit is contained in:
@@ -228,8 +228,7 @@ pub async fn install_zipped_mrpack_files(
|
||||
|
||||
let num_files = pack.files.len();
|
||||
loading_try_for_each_concurrent(
|
||||
futures::stream::iter(pack.files.into_iter())
|
||||
.map(Ok::<PackFile, crate::Error>),
|
||||
futures::stream::iter(pack.files).map(Ok::<PackFile, crate::Error>),
|
||||
None,
|
||||
Some(&loading_bar),
|
||||
70.0,
|
||||
|
||||
@@ -150,8 +150,8 @@ pub async fn resolve_server_address(
|
||||
match resolver.srv_lookup(format!("_minecraft._tcp.{host}")).await {
|
||||
Err(e)
|
||||
if e.proto()
|
||||
.filter(|x| x.kind().is_no_records_found())
|
||||
.is_some() =>
|
||||
.as_ref()
|
||||
.is_some_and(|x| x.kind().is_no_records_found()) =>
|
||||
{
|
||||
None
|
||||
}
|
||||
|
||||
@@ -791,7 +791,7 @@ pub async fn remove_server_from_profile(
|
||||
index: usize,
|
||||
) -> Result<()> {
|
||||
let mut servers = servers_data::read(profile_path).await?;
|
||||
if servers.get(index).filter(|x| !x.hidden).is_none() {
|
||||
if servers.get(index).as_ref().is_none_or(|x| x.hidden) {
|
||||
return Err(ErrorKind::InputError(format!(
|
||||
"No removable server at index {index}"
|
||||
))
|
||||
|
||||
@@ -59,31 +59,28 @@ pub async fn init_watcher() -> crate::Result<FileWatcher> {
|
||||
.nth(1)
|
||||
.map(|x| x.as_os_str());
|
||||
if first_file_name
|
||||
.filter(|x| *x == "crash-reports")
|
||||
.is_some()
|
||||
.as_ref()
|
||||
.is_some_and(|x| *x == "crash-reports")
|
||||
&& e.path
|
||||
.extension()
|
||||
.filter(|x| *x == "txt")
|
||||
.is_some()
|
||||
.as_ref()
|
||||
.is_some_and(|x| *x == "txt")
|
||||
{
|
||||
crash_task(profile_path_str);
|
||||
} else if !visited_profiles.contains(&profile_path)
|
||||
{
|
||||
let event = if first_file_name
|
||||
.filter(|x| *x == "servers.dat")
|
||||
.is_some()
|
||||
.as_ref()
|
||||
.is_some_and(|x| *x == "servers.dat")
|
||||
{
|
||||
Some(ProfilePayloadType::ServersUpdated)
|
||||
} else if first_file_name
|
||||
.filter(|x| {
|
||||
*x == "saves"
|
||||
&& e.path
|
||||
.file_name()
|
||||
.filter(|x| *x == "level.dat")
|
||||
.is_some()
|
||||
})
|
||||
.is_some()
|
||||
{
|
||||
} else if first_file_name.as_ref().is_some_and(|x| {
|
||||
*x == "saves"
|
||||
&& e.path
|
||||
.file_name()
|
||||
.as_ref()
|
||||
.is_some_and(|x| *x == "level.dat")
|
||||
}) {
|
||||
tracing::info!(
|
||||
"World updated: {}",
|
||||
e.path.display()
|
||||
@@ -113,8 +110,8 @@ pub async fn init_watcher() -> crate::Result<FileWatcher> {
|
||||
}
|
||||
Some(ProfilePayloadType::WorldUpdated { world })
|
||||
} else if first_file_name
|
||||
.filter(|x| *x == "saves")
|
||||
.is_none()
|
||||
.as_ref()
|
||||
.is_none_or(|x| *x != "saves")
|
||||
{
|
||||
Some(ProfilePayloadType::Synced)
|
||||
} else {
|
||||
|
||||
@@ -283,7 +283,7 @@ fn check_modpack_update(
|
||||
.collect();
|
||||
|
||||
// Sort by date_published descending (newest first)
|
||||
compatible_versions.sort_by(|a, b| b.date_published.cmp(&a.date_published));
|
||||
compatible_versions.sort_by_key(|b| std::cmp::Reverse(b.date_published));
|
||||
|
||||
// Find the newest compatible version
|
||||
if let Some(newest) = compatible_versions.first() {
|
||||
|
||||
Reference in New Issue
Block a user