window: Only clean login if a new session is ready

This commit is contained in:
Kévin Commaille 2022-10-22 16:12:46 +02:00
parent 340fff5276
commit 26c182b052
No known key found for this signature in database
GPG key ID: DD507DAE96E8245C
2 changed files with 4 additions and 3 deletions

View file

@ -571,6 +571,10 @@ impl Login {
); );
return; return;
} }
session.connect_ready(clone!(@weak self as obj => move |_| {
obj.clean();
}));
}; };
session.prepare(client, session_info).await; session.prepare(client, session_info).await;

View file

@ -182,9 +182,6 @@ impl Window {
// We need to grab the focus so that keyboard shortcuts work // We need to grab the focus so that keyboard shortcuts work
session.grab_focus(); session.grab_focus();
session.connect_ready(clone!(@weak self as obj => move |_| {
obj.imp().login.clean();
}));
session.connect_logged_out(clone!(@weak self as obj => move |session| { session.connect_logged_out(clone!(@weak self as obj => move |session| {
obj.remove_session(session) obj.remove_session(session)
})); }));