From 2b0f18286f45374662a559b43cc704924467fe3b Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 8 Dec 2024 07:45:10 +0200 Subject: [PATCH] update dialog widget on identity disconnect action --- .../tab/item/identity/gemini/widget/form.rs | 2 +- .../tab/item/identity/gemini/widget/form/exit.rs | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/app/browser/window/tab/item/identity/gemini/widget/form.rs b/src/app/browser/window/tab/item/identity/gemini/widget/form.rs index ef30c646..91865d03 100644 --- a/src/app/browser/window/tab/item/identity/gemini/widget/form.rs +++ b/src/app/browser/window/tab/item/identity/gemini/widget/form.rs @@ -53,7 +53,7 @@ impl Form { let save = Rc::new(Save::new(profile.clone(), list.clone())); let drop = Rc::new(Drop::new(profile.clone(), list.clone())); let exit = Rc::new(Exit::new( - action.0.clone(), + (action.0.clone(), action.2.clone()), profile.clone(), list.clone(), auth_uri.clone(), diff --git a/src/app/browser/window/tab/item/identity/gemini/widget/form/exit.rs b/src/app/browser/window/tab/item/identity/gemini/widget/form/exit.rs index 46cde75a..e0b714ea 100644 --- a/src/app/browser/window/tab/item/identity/gemini/widget/form/exit.rs +++ b/src/app/browser/window/tab/item/identity/gemini/widget/form/exit.rs @@ -1,6 +1,8 @@ -use super::list::{item::Value, List}; -use crate::app::browser::action::Action as BrowserAction; -use crate::profile::Profile; +use super::{ + list::{item::Value, List}, + WidgetAction, +}; +use crate::{app::browser::Action as BrowserAction, Profile}; use adw::{ prelude::{AdwDialogExt, AlertDialogExt, AlertDialogExtManual}, AlertDialog, ResponseAppearance, @@ -32,7 +34,7 @@ impl Exit { /// Create new `Self` pub fn new( - browser_action: Rc, + action: (Rc, Rc), profile: Rc, list: Rc, auth_uri: Uri, @@ -78,10 +80,11 @@ impl Exit { // Connect confirmation event alert_dialog.connect_response(Some(RESPONSE_CONFIRM.0), { let auth_uri = auth_uri.clone(); - let browser_action = browser_action.clone(); let button = button.clone(); let list = list.clone(); let profile = profile.clone(); + let browser_action = action.0.clone(); + let widget_action = action.1.clone(); move |_, _| { match profile .identity @@ -107,7 +110,8 @@ impl Exit { button.set_label(&e.to_string()) } } - browser_action.update.activate(None) + browser_action.update.activate(None); + widget_action.update.activate(); } });