Read-only access for channel guests (#3841)

This commit is contained in:
Conrad Irwin 2024-01-05 11:21:18 -07:00 committed by GitHub
commit 1a993ca496
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 619 additions and 191 deletions

View file

@ -1187,7 +1187,7 @@ impl Workspace {
mut save_intent: SaveIntent,
cx: &mut ViewContext<Self>,
) -> Task<Result<bool>> {
if self.project.read(cx).is_read_only() {
if self.project.read(cx).is_disconnected() {
return Task::ready(Ok(true));
}
let dirty_items = self
@ -2510,7 +2510,7 @@ impl Workspace {
}
fn update_window_edited(&mut self, cx: &mut ViewContext<Self>) {
let is_edited = !self.project.read(cx).is_read_only()
let is_edited = !self.project.read(cx).is_disconnected()
&& self
.items(cx)
.any(|item| item.has_conflict(cx) || item.is_dirty(cx));
@ -3635,7 +3635,7 @@ impl Render for Workspace {
})),
)
.child(self.status_bar.clone())
.children(if self.project.read(cx).is_read_only() {
.children(if self.project.read(cx).is_disconnected() {
Some(DisconnectedOverlay)
} else {
None