mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-03 16:41:26 +01:00
fix(gui): read the new session off the main thread after sign-in (B246)
This commit is contained in:
1 parent
4bf176a631
commit
7384d8e97d
2 files changed
+28
-1
No files matched your search
@@ -199,7 +199,13 @@ pub(crate) fn wire_login(ui: &Rc<Ui>) {
|
||||
ui.login.login_status.set_text("");
|
||||
ui.login.password.set_text("");
|
||||
// Cache the new identity so `refresh` never hits the keyring.
|
||||
*ui.session.borrow_mut() = auth::load().ok();
|
||||
// Read on a worker: a keyring that has to be unlocked first
|
||||
// answers only once the user has, and the window must not
|
||||
// freeze until then.
|
||||
*ui.session.borrow_mut() = gio::spawn_blocking(|| auth::load().ok())
|
||||
.await
|
||||
.ok()
|
||||
.flatten();
|
||||
// Enable+start the mount service now that we have a session.
|
||||
let _ = gio::spawn_blocking(service::enable_start).await;
|
||||
refresh(&ui);
|
||||
|
||||
Reference in new issue
Block a user