mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 14:01:37 +00:00
Update button layout order in ConfirmingPage and enhance error handling in change processor
- Changed the layout order of the reject button in the ConfirmingPage to improve UI consistency. - Added error handling for file operations in the change processor, logging errors when file removal or writing fails, enhancing robustness and debuggability.
This commit is contained in:
parent
06d5ff4d80
commit
8650cdbd82
2 changed files with 20 additions and 4 deletions
|
|
@ -95,7 +95,7 @@ function ConfirmingPage:render()
|
||||||
text = "Reject",
|
text = "Reject",
|
||||||
style = "Warning",
|
style = "Warning",
|
||||||
transparency = self.props.transparency,
|
transparency = self.props.transparency,
|
||||||
layoutOrder = 2,
|
layoutOrder = 0,
|
||||||
onClick = function()
|
onClick = function()
|
||||||
self:setState({ showingRejectConfirm = true })
|
self:setState({ showingRejectConfirm = true })
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,16 @@ impl JobThreadContext {
|
||||||
if let Some(instance) = tree.get_instance(id) {
|
if let Some(instance) = tree.get_instance(id) {
|
||||||
if let Some(instigating_source) = &instance.metadata().instigating_source {
|
if let Some(instigating_source) = &instance.metadata().instigating_source {
|
||||||
match instigating_source {
|
match instigating_source {
|
||||||
InstigatingSource::Path(path) => fs::remove_file(path).unwrap(),
|
InstigatingSource::Path(path) => {
|
||||||
|
if let Err(err) = fs::remove_file(path) {
|
||||||
|
log::error!(
|
||||||
|
"Failed to remove file {:?} for instance {:?}: {}",
|
||||||
|
path,
|
||||||
|
id,
|
||||||
|
err
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
InstigatingSource::ProjectNode { .. } => {
|
InstigatingSource::ProjectNode { .. } => {
|
||||||
log::warn!(
|
log::warn!(
|
||||||
"Cannot remove instance {:?}, it's from a project file",
|
"Cannot remove instance {:?}, it's from a project file",
|
||||||
|
|
@ -244,14 +253,21 @@ impl JobThreadContext {
|
||||||
match instigating_source {
|
match instigating_source {
|
||||||
InstigatingSource::Path(path) => {
|
InstigatingSource::Path(path) => {
|
||||||
if let Some(Variant::String(value)) = changed_value {
|
if let Some(Variant::String(value)) = changed_value {
|
||||||
fs::write(path, value).unwrap();
|
if let Err(err) = fs::write(path, value) {
|
||||||
|
log::error!(
|
||||||
|
"Failed to write Source to {:?} for instance {:?}: {}",
|
||||||
|
path,
|
||||||
|
id,
|
||||||
|
err
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
log::warn!("Cannot change Source to non-string value.");
|
log::warn!("Cannot change Source to non-string value.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
InstigatingSource::ProjectNode { .. } => {
|
InstigatingSource::ProjectNode { .. } => {
|
||||||
log::warn!(
|
log::warn!(
|
||||||
"Cannot remove instance {:?}, it's from a project file",
|
"Cannot update instance {:?}, it's from a project file",
|
||||||
id
|
id
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue