mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-11 13:10:54 +00:00
Make replica_id
optional in OpenWorktreeResponse
This commit is contained in:
parent
02321af08a
commit
f1587fbb6e
2 changed files with 12 additions and 3 deletions
|
@ -43,7 +43,7 @@ message OpenWorktree {
|
|||
|
||||
message OpenWorktreeResponse {
|
||||
Worktree worktree = 1;
|
||||
uint32 replica_id = 2;
|
||||
optional uint32 replica_id = 2;
|
||||
}
|
||||
|
||||
message AddGuest {
|
||||
|
|
|
@ -766,12 +766,21 @@ impl Workspace {
|
|||
let worktree = open_worktree_response
|
||||
.worktree
|
||||
.ok_or_else(|| anyhow!("empty worktree"))?;
|
||||
let replica_id = open_worktree_response.replica_id as ReplicaId;
|
||||
let replica_id = open_worktree_response
|
||||
.replica_id
|
||||
.ok_or_else(|| anyhow!("empty replica id"))?;
|
||||
|
||||
let worktree_id = worktree_id.try_into().unwrap();
|
||||
this.update(&mut cx, |workspace, cx| {
|
||||
let worktree = cx.add_model(|cx| {
|
||||
Worktree::remote(worktree_id, worktree, rpc, connection_id, replica_id, cx)
|
||||
Worktree::remote(
|
||||
worktree_id,
|
||||
worktree,
|
||||
rpc,
|
||||
connection_id,
|
||||
replica_id as ReplicaId,
|
||||
cx,
|
||||
)
|
||||
});
|
||||
cx.observe_model(&worktree, |_, _, cx| cx.notify());
|
||||
workspace.worktrees.insert(worktree);
|
||||
|
|
Loading…
Reference in a new issue