settings: Follow-up fix to show more errors (#18123)
The condition added in #18122 was too strict. Release Notes: - N/A
This commit is contained in:
parent
ace4d5185d
commit
97708fdf43
1 changed files with 19 additions and 17 deletions
|
@ -629,26 +629,28 @@ fn handle_settings_changed(error: Option<anyhow::Error>, cx: &mut AppContext) {
|
||||||
for workspace in workspace::local_workspace_windows(cx) {
|
for workspace in workspace::local_workspace_windows(cx) {
|
||||||
workspace
|
workspace
|
||||||
.update(cx, |workspace, cx| {
|
.update(cx, |workspace, cx| {
|
||||||
match error
|
match error.as_ref() {
|
||||||
.as_ref()
|
Some(error) => {
|
||||||
.and_then(|error| error.downcast_ref::<InvalidSettingsError>())
|
if let Some(InvalidSettingsError::LocalSettings { .. }) =
|
||||||
{
|
error.downcast_ref::<InvalidSettingsError>()
|
||||||
Some(InvalidSettingsError::UserSettings { message }) => {
|
{
|
||||||
workspace.show_notification(id.clone(), cx, |cx| {
|
// Local settings will be displayed by the projects
|
||||||
cx.new_view(|_| {
|
} else {
|
||||||
MessageNotification::new(format!(
|
workspace.show_notification(id.clone(), cx, |cx| {
|
||||||
"Invalid user settings file\n{message}"
|
cx.new_view(|_| {
|
||||||
))
|
MessageNotification::new(format!(
|
||||||
.with_click_message("Open settings file")
|
"Invalid user settings file\n{error}"
|
||||||
.on_click(|cx| {
|
))
|
||||||
cx.dispatch_action(zed_actions::OpenSettings.boxed_clone());
|
.with_click_message("Open settings file")
|
||||||
cx.emit(DismissEvent);
|
.on_click(|cx| {
|
||||||
|
cx.dispatch_action(zed_actions::OpenSettings.boxed_clone());
|
||||||
|
cx.emit(DismissEvent);
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
None => workspace.dismiss_notification(&id, cx),
|
None => workspace.dismiss_notification(&id, cx),
|
||||||
_ => {}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.log_err();
|
.log_err();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue