Workspaces: Save, Save As, Rename and Delete fail when the file isn't written (#696)
This commit is contained in:
@@ -428,9 +428,16 @@ impl EffectcraftApp {
|
||||
}
|
||||
|
||||
/// Keep the saved workspaces for the next session (see [`EffectcraftApp::new`]): After
|
||||
/// Effects' saved workspaces last until they are deleted (#320).
|
||||
pub(crate) fn store_saved_workspaces(&mut self) {
|
||||
self.save_workspace_state();
|
||||
/// Effects' saved workspaces last until they are deleted (#320). `Err` when they weren't
|
||||
/// written (#696): the layouts stay usable and a later save retries, but a restart loses them.
|
||||
pub(crate) fn store_saved_workspaces(&mut self) -> Result<(), String> {
|
||||
let Err(error) = self.workspace_store.save_now(self.session.config.as_deref(), &self.ui) else { return Ok(()) };
|
||||
let message = format!("Workspaces are kept for this session only and won't be there after a restart: {error}");
|
||||
log::warn!("{message}");
|
||||
self.ui.status = message.clone();
|
||||
// The raw error, so the background retry doesn't report the same failure again.
|
||||
self.workspace_store.error = Some(error);
|
||||
Err(message)
|
||||
}
|
||||
|
||||
/// Offer the frontend's commands (tools, timeline navigation…) for keyboard shortcuts.
|
||||
|
||||
Reference in New Issue
Block a user