@@ -1393,7 +1393,7 @@ pub(crate) async fn restore_or_create_workspace(
.update(cx, |multi_workspace, _, cx| {
multi_workspace.workspace().update(cx, |workspace, cx| {
workspace.show_toast(
- Toast::new(NotificationId::unique::<()>(), message),
+ Toast::new(NotificationId::unique::<()>(), message.clone()),
cx,
)
});
@@ -1405,11 +1405,23 @@ pub(crate) async fn restore_or_create_workspace(
});
// If we couldn't show a toast (no windows opened successfully),
- // we've already logged the errors above, so the user can check logs
+ // open a fallback empty workspace and show the error there
if !toast_shown {
- log::error!(
- "Failed to show notification for window restoration errors, because no workspace windows were available."
- );
+ log::error!("All workspace restorations failed. Opening fallback empty workspace.");
+ cx.update(|cx| {
+ workspace::open_new(
+ Default::default(),
+ app_state.clone(),
+ cx,
+ |workspace, _window, cx| {
+ workspace.show_toast(
+ Toast::new(NotificationId::unique::<()>(), message),
+ cx,
+ );
+ },
+ )
+ })
+ .await?;
}
}
} else if matches!(KEY_VALUE_STORE.read_kvp(FIRST_OPEN), Ok(None)) {