Fix circular reference issue around PopoverMenu again (#44084)

Follow up to https://github.com/zed-industries/zed/pull/42351

Release Notes:

- N/A
This commit is contained in:
feeiyu
2025-12-03 21:34:01 +02:00
committed by GitHub
parent 4ef8433396
commit 92dcfdef76
4 changed files with 24 additions and 17 deletions
+10 -8
View File
@@ -739,7 +739,7 @@ impl ExtensionsPage {
extension: &ExtensionMetadata,
cx: &mut Context<Self>,
) -> ExtensionCard {
let this = cx.entity();
let this = cx.weak_entity();
let status = Self::extension_status(&extension.id, cx);
let has_dev_extension = Self::dev_extension_exists(&extension.id, cx);
@@ -889,13 +889,15 @@ impl ExtensionsPage {
y: px(2.0),
})
.menu(move |window, cx| {
Some(Self::render_remote_extension_context_menu(
&this,
extension_id.clone(),
authors.clone(),
window,
cx,
))
this.upgrade().map(|this| {
Self::render_remote_extension_context_menu(
&this,
extension_id.clone(),
authors.clone(),
window,
cx,
)
})
}),
),
),