diff --git a/src/session/content/mod.rs b/src/session/content/mod.rs index bafe566e..b8f6f4f6 100644 --- a/src/session/content/mod.rs +++ b/src/session/content/mod.rs @@ -14,7 +14,7 @@ use self::verification::IdentityVerificationWidget; use crate::session::sidebar::{Entry, EntryType}; -use crate::session::verification::{IdentityVerification, VerificationMode}; +use crate::session::verification::IdentityVerification; use adw::subclass::prelude::*; use gtk::{gio, glib, glib::clone, prelude::*, subclass::prelude::*, CompositeTemplate}; @@ -219,12 +219,15 @@ impl Content { } if item.is::() { - let handler_id = item.connect_notify_local(Some("mode"), clone!(@weak self as obj => move |request, _| { - let request = request.downcast_ref::().unwrap(); - if request.mode() == VerificationMode::Cancelled || request.mode() == VerificationMode::Error || request.mode() == VerificationMode::Dismissed { - obj.set_item(None); - } - })); + let handler_id = item.connect_notify_local( + Some("mode"), + clone!(@weak self as obj => move |request, _| { + let request = request.downcast_ref::().unwrap(); + if request.is_finished() { + obj.set_item(None); + } + }), + ); priv_.signal_handler.replace(Some(handler_id)); } }