workspace: Fix last removed folder from workspace used to reopen on Zed startup (#34925)
Closes #34924 Now, when `local_paths` are empty, we detach `session_id` from that workspace serialization item. This way, when we restore it using the default "last_session", we don't restore this workspace back. This is same as when we use `cmd-w` to close window, which also sets `session_id` to `None` before serialization. Release Notes: - Fixed an issue where last removed folder from workspace used to reopen on Zed startup.
This commit is contained in:
parent
056003860a
commit
e90cf0b941
2 changed files with 61 additions and 34 deletions
|
@ -1336,6 +1336,14 @@ impl WorkspaceDb {
|
|||
}
|
||||
}
|
||||
|
||||
query! {
|
||||
pub(crate) async fn set_session_id(workspace_id: WorkspaceId, session_id: Option<String>) -> Result<()> {
|
||||
UPDATE workspaces
|
||||
SET session_id = ?2
|
||||
WHERE workspace_id = ?1
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn toolchain(
|
||||
&self,
|
||||
workspace_id: WorkspaceId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue