Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
copilot: Fix double lease panic when signing out (#46619)
Piotr Osiewicz0eeb743904bb
diff --git a/crates/copilot/src/sign_in.rs b/crates/copilot/src/sign_in.rsindex 4f71a34408e..ed633fe9306 100644--- a/crates/copilot/src/sign_in.rs+++ b/crates/copilot/src/sign_in.rs@@ -89,10 +89,12 @@ fn copilot_toast(message: Option<&'static str>, window: &Window, cx: &mut App) {return;};- workspace.update(cx, |workspace, cx| match message {- Some(message) => workspace.show_toast(Toast::new(NOTIFICATION_ID, message), cx),- None => workspace.dismiss_toast(&NOTIFICATION_ID, cx),- });+ cx.defer(move |cx| {+ workspace.update(cx, |workspace, cx| match message {+ Some(message) => workspace.show_toast(Toast::new(NOTIFICATION_ID, message), cx),+ None => workspace.dismiss_toast(&NOTIFICATION_ID, cx),+ });+ })}pub fn initiate_sign_in_impl(is_reinstall: bool, window: &mut Window, cx: &mut App) {