mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-11 21:13:02 +00:00
Remove project from host connection when unregistering it
This commit is contained in:
parent
466db69780
commit
ce59e57e6d
1 changed files with 7 additions and 0 deletions
|
@ -297,6 +297,11 @@ impl Store {
|
||||||
}
|
}
|
||||||
|
|
||||||
let project = e.remove();
|
let project = e.remove();
|
||||||
|
|
||||||
|
if let Some(host_connection) = self.connections.get_mut(&connection_id) {
|
||||||
|
host_connection.projects.remove(&project_id);
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(share) = &project.share {
|
if let Some(share) = &project.share {
|
||||||
for guest_connection in share.guests.keys() {
|
for guest_connection in share.guests.keys() {
|
||||||
if let Some(connection) = self.connections.get_mut(&guest_connection) {
|
if let Some(connection) = self.connections.get_mut(&guest_connection) {
|
||||||
|
@ -305,6 +310,8 @@ impl Store {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
self.check_invariants();
|
||||||
Ok(project)
|
Ok(project)
|
||||||
} else {
|
} else {
|
||||||
Err(anyhow!("no such project"))?
|
Err(anyhow!("no such project"))?
|
||||||
|
|
Loading…
Reference in a new issue