close notification handler proper on accept/decline
Co-authored-by: Conrad <conrad@zed.dev>
This commit is contained in:
parent
8ca9f4e12a
commit
b2b5df4428
2 changed files with 6 additions and 4 deletions
|
@ -18,9 +18,9 @@ pub fn init(app_state: &Arc<AppState>, cx: &mut AppContext) {
|
||||||
while let Some(incoming_call) = incoming_call.next().await {
|
while let Some(incoming_call) = incoming_call.next().await {
|
||||||
for window in notification_windows.drain(..) {
|
for window in notification_windows.drain(..) {
|
||||||
window
|
window
|
||||||
.update(&mut cx, |_, _| {
|
.update(&mut cx, |_, cx| {
|
||||||
// todo!()
|
// todo!()
|
||||||
//cx.remove_window();
|
cx.remove_window();
|
||||||
})
|
})
|
||||||
.log_err();
|
.log_err();
|
||||||
}
|
}
|
||||||
|
|
|
@ -580,7 +580,7 @@ impl AppContext {
|
||||||
.windows
|
.windows
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|(_, window)| {
|
.filter_map(|(_, window)| {
|
||||||
let window = window.as_ref().unwrap();
|
let window = window.as_ref()?;
|
||||||
if window.dirty {
|
if window.dirty {
|
||||||
Some(window.handle.clone())
|
Some(window.handle.clone())
|
||||||
} else {
|
} else {
|
||||||
|
@ -1049,7 +1049,9 @@ impl Context for AppContext {
|
||||||
let root_view = window.root_view.clone().unwrap();
|
let root_view = window.root_view.clone().unwrap();
|
||||||
let result = update(root_view, &mut WindowContext::new(cx, &mut window));
|
let result = update(root_view, &mut WindowContext::new(cx, &mut window));
|
||||||
|
|
||||||
if !window.removed {
|
if window.removed {
|
||||||
|
cx.windows.remove(handle.id);
|
||||||
|
} else {
|
||||||
cx.windows
|
cx.windows
|
||||||
.get_mut(handle.id)
|
.get_mut(handle.id)
|
||||||
.ok_or_else(|| anyhow!("window not found"))?
|
.ok_or_else(|| anyhow!("window not found"))?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue