update dialog widget on identity disconnect action

This commit is contained in:
yggverse 2024-12-08 07:45:10 +02:00
parent a361c5aa97
commit 2b0f18286f
2 changed files with 11 additions and 7 deletions

View File

@ -53,7 +53,7 @@ impl Form {
let save = Rc::new(Save::new(profile.clone(), list.clone())); let save = Rc::new(Save::new(profile.clone(), list.clone()));
let drop = Rc::new(Drop::new(profile.clone(), list.clone())); let drop = Rc::new(Drop::new(profile.clone(), list.clone()));
let exit = Rc::new(Exit::new( let exit = Rc::new(Exit::new(
action.0.clone(), (action.0.clone(), action.2.clone()),
profile.clone(), profile.clone(),
list.clone(), list.clone(),
auth_uri.clone(), auth_uri.clone(),

View File

@ -1,6 +1,8 @@
use super::list::{item::Value, List}; use super::{
use crate::app::browser::action::Action as BrowserAction; list::{item::Value, List},
use crate::profile::Profile; WidgetAction,
};
use crate::{app::browser::Action as BrowserAction, Profile};
use adw::{ use adw::{
prelude::{AdwDialogExt, AlertDialogExt, AlertDialogExtManual}, prelude::{AdwDialogExt, AlertDialogExt, AlertDialogExtManual},
AlertDialog, ResponseAppearance, AlertDialog, ResponseAppearance,
@ -32,7 +34,7 @@ impl Exit {
/// Create new `Self` /// Create new `Self`
pub fn new( pub fn new(
browser_action: Rc<BrowserAction>, action: (Rc<BrowserAction>, Rc<WidgetAction>),
profile: Rc<Profile>, profile: Rc<Profile>,
list: Rc<List>, list: Rc<List>,
auth_uri: Uri, auth_uri: Uri,
@ -78,10 +80,11 @@ impl Exit {
// Connect confirmation event // Connect confirmation event
alert_dialog.connect_response(Some(RESPONSE_CONFIRM.0), { alert_dialog.connect_response(Some(RESPONSE_CONFIRM.0), {
let auth_uri = auth_uri.clone(); let auth_uri = auth_uri.clone();
let browser_action = browser_action.clone();
let button = button.clone(); let button = button.clone();
let list = list.clone(); let list = list.clone();
let profile = profile.clone(); let profile = profile.clone();
let browser_action = action.0.clone();
let widget_action = action.1.clone();
move |_, _| { move |_, _| {
match profile match profile
.identity .identity
@ -107,7 +110,8 @@ impl Exit {
button.set_label(&e.to_string()) button.set_label(&e.to_string())
} }
} }
browser_action.update.activate(None) browser_action.update.activate(None);
widget_action.update.activate();
} }
}); });