Bug fixes round 3 (#298)

* fixed bugs

* title case

* bugs; ioerror

* reset breadcrumbs

* more fixes

* more fixes

* scrolling bug

* more fixes

* more fixes

* clippy

* canonicalize fix

* fixed requested changes

* removed debouncer update
This commit is contained in:
Wyatt Verchere
2023-07-19 14:13:25 -07:00
committed by GitHub
parent 6650cc9ce4
commit 1f478ec9fc
34 changed files with 932 additions and 602 deletions

View File

@@ -1,5 +1,6 @@
//! Theseus profile management interface
use crate::state::LinkedData;
use crate::util::io::{self, canonicalize};
use crate::{
event::{emit::emit_profile, ProfilePayloadType},
prelude::ModLoader,
@@ -9,11 +10,9 @@ pub use crate::{
State,
};
use daedalus::modded::LoaderVersion;
use dunce::canonicalize;
use futures::prelude::*;
use std::path::PathBuf;
use tokio::fs;
use tokio_stream::wrappers::ReadDirStream;
use tracing::{info, trace};
use uuid::Uuid;
@@ -48,7 +47,7 @@ pub async fn profile_create(
.into());
}
if ReadDirStream::new(fs::read_dir(&path).await?)
if ReadDirStream::new(io::read_dir(&path).await?)
.next()
.await
.is_some()
@@ -56,7 +55,7 @@ pub async fn profile_create(
return Err(ProfileCreationError::NotEmptyFolder.into());
}
} else {
fs::create_dir_all(&path).await?;
io::create_dir_all(&path).await?;
}
info!(
@@ -80,7 +79,7 @@ pub async fn profile_create(
Profile::new(uuid, name, game_version, path.clone()).await?;
let result = async {
if let Some(ref icon) = icon {
let bytes = tokio::fs::read(icon).await?;
let bytes = io::read(icon).await?;
profile
.set_icon(
&state.directories.caches_dir(),