Fix issues relating to app directory changes (#5826)
* Fix canceling app directory change * Improve directory moving error messages * tombi
This commit is contained in:
@@ -364,10 +364,9 @@ impl DirectoryInfo {
|
||||
.map_err(|e| {
|
||||
crate::Error::from(crate::ErrorKind::DirectoryMoveError(
|
||||
format!(
|
||||
"Failed to move directory from {} to {}: {}",
|
||||
"Failed to move directory from {} to {}: {e:?}",
|
||||
x.old.display(),
|
||||
x.new.display(),
|
||||
e
|
||||
),
|
||||
))
|
||||
})?;
|
||||
@@ -421,7 +420,7 @@ impl DirectoryInfo {
|
||||
io_semaphore,
|
||||
)
|
||||
.await.map_err(|e| { crate::Error::from(
|
||||
crate::ErrorKind::DirectoryMoveError(format!("Failed to move directory from {} to {}: {}", x.old.display(), x.new.display(), e)))
|
||||
crate::ErrorKind::DirectoryMoveError(format!("Failed to move directory from {} to {}: {e:?}", x.old.display(), x.new.display())))
|
||||
})?;
|
||||
|
||||
let _ = emit_loading(
|
||||
|
||||
@@ -74,9 +74,12 @@ pub struct State {
|
||||
/// Process manager
|
||||
pub process_manager: ProcessManager,
|
||||
|
||||
/// App identifier string (like com.modrinth.ModrinthApp)
|
||||
pub app_identifier: String,
|
||||
|
||||
// NOTE: we explicitly must NOT store the app identifier in the state object,
|
||||
// because creating the state object is fallible (e.g. database missing),
|
||||
// but we rely on the app identifier to create the state (data dir).
|
||||
//
|
||||
// /// App identifier string (like com.modrinth.ModrinthApp)
|
||||
// pub app_identifier: String,
|
||||
/// Friends socket
|
||||
pub friends_socket: FriendsSocket,
|
||||
|
||||
@@ -188,7 +191,7 @@ impl State {
|
||||
friends_socket,
|
||||
pool,
|
||||
file_watcher,
|
||||
app_identifier,
|
||||
// app_identifier,
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user