Avoid another confirmation when submitting/discarding feedback (#7569)

Fixes https://github.com/zed-industries/zed/issues/7515

Release Notes:

- Fixed feedback modal spawning extra confirmations on cancel and submit
([7515](https://github.com/zed-industries/zed/issues/7515))
This commit is contained in:
Kirill Bulatov 2024-02-08 16:13:54 +02:00 committed by GitHub
parent d457eef099
commit f734365b7b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 37 additions and 17 deletions

View file

@ -20,7 +20,7 @@ use std::{
use theme::{color_alpha, ActiveTheme, ThemeSettings};
use ui::{prelude::*, ListItem, ListItemSpacing};
use util::ResultExt;
use workspace::ModalView;
use workspace::{DismissDecision, ModalView};
actions!(outline, [Toggle]);
@ -55,10 +55,10 @@ impl FocusableView for OutlineView {
impl EventEmitter<DismissEvent> for OutlineView {}
impl ModalView for OutlineView {
fn on_before_dismiss(&mut self, cx: &mut ViewContext<Self>) -> bool {
fn on_before_dismiss(&mut self, cx: &mut ViewContext<Self>) -> DismissDecision {
self.picker
.update(cx, |picker, cx| picker.delegate.restore_active_editor(cx));
true
DismissDecision::Dismiss(true)
}
}