Introduce weak_handle methods on ModelContext and ViewContext
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
29b616f4cc
commit
4cc1556ca4
7 changed files with 21 additions and 13 deletions
|
@ -96,7 +96,7 @@ impl ChatPanel {
|
|||
});
|
||||
|
||||
let mut message_list = ListState::new(0, Orientation::Bottom, 1000., {
|
||||
let this = cx.handle().downgrade();
|
||||
let this = cx.weak_handle();
|
||||
move |ix, cx| {
|
||||
let this = this.upgrade(cx).unwrap().read(cx);
|
||||
let message = this.active_channel.as_ref().unwrap().0.read(cx).message(ix);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue