Remove lock from element states

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra
2021-08-27 18:04:21 +02:00
co-authored by Nathan Sobo
parent d5b7e2d4e3
commit 53dc08dfc5
14 changed files with 143 additions and 104 deletions
+3 -3
View File
@@ -99,7 +99,7 @@ impl ChatPanel {
cx.notify();
}
fn render_channel_name(&self, cx: &RenderContext<Self>) -> ElementBox {
fn render_channel_name(&self, cx: &mut RenderContext<Self>) -> ElementBox {
let settings = self.settings.borrow();
let theme = &settings.theme.chat_panel;
if let Some((channel, _)) = self.active_channel.as_ref() {
@@ -121,7 +121,7 @@ impl ChatPanel {
}
}
fn render_active_channel_messages(&self, cx: &RenderContext<Self>) -> ElementBox {
fn render_active_channel_messages(&self, cx: &mut RenderContext<Self>) -> ElementBox {
let messages = if let Some((channel, _)) = self.active_channel.as_ref() {
let channel = channel.read(cx);
let now = OffsetDateTime::now_utc();
@@ -202,7 +202,7 @@ impl View for ChatPanel {
"ChatPanel"
}
fn render(&self, cx: &RenderContext<Self>) -> ElementBox {
fn render(&self, cx: &mut RenderContext<Self>) -> ElementBox {
let theme = &self.settings.borrow().theme;
Container::new(
Flex::column()