aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Lionel <lionel@les-miquelots.net>2024-01-21 14:16:57 +0100
committerMiquel Lionel <lionel@les-miquelots.net>2024-01-22 00:37:17 +0100
commit1ca0326e8a5295567daadd45d240399b1878fcbd (patch)
treea736e96cd8eb8f09faed9e697bb45291369a10a9
parent7e3cedaf3fa347bfa688e71b0f69e62725db395d (diff)
downloaddino-1ca0326e8a5295567daadd45d240399b1878fcbd.tar.gz
dino-1ca0326e8a5295567daadd45d240399b1878fcbd.zip
Fix crash when toggling an account very fast (#1505)fix-assertion-account-has-key
- The switch widget in the account managment dialog is now not accepting input while the account being enabled is connecting.
-rw-r--r--main/src/ui/manage_accounts/dialog.vala4
1 files changed, 4 insertions, 0 deletions
diff --git a/main/src/ui/manage_accounts/dialog.vala b/main/src/ui/manage_accounts/dialog.vala
index a326aeff..a7c0cf6e 100644
--- a/main/src/ui/manage_accounts/dialog.vala
+++ b/main/src/ui/manage_accounts/dialog.vala
@@ -183,6 +183,7 @@ public class Dialog : Gtk.Dialog {
}
private void populate_grid_data(Account account) {
+ active_switch.sensitive = false;
active_switch.state_set.disconnect(change_account_state);
picture.model = new ViewModel.CompatAvatarPictureModel(stream_interactor).add_participant(new Conversation(account.bare_jid, account, Conversation.Type.CHAT), account.bare_jid);
@@ -213,10 +214,13 @@ public class Dialog : Gtk.Dialog {
ConnectionManager.ConnectionState state = stream_interactor.connection_manager.get_state(account);
switch (state) {
case ConnectionManager.ConnectionState.CONNECTING:
+ active_switch.sensitive = false;
state_label.label = _("Connecting…"); break;
case ConnectionManager.ConnectionState.CONNECTED:
+ active_switch.sensitive = true;
state_label.label = _("Connected"); break;
case ConnectionManager.ConnectionState.DISCONNECTED:
+ active_switch.sensitive = true;
state_label.label = _("Disconnected"); break;
}
state_label.remove_css_class("is_error");