Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when toggling an account very fast (#1505) #82

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions main/src/ui/manage_accounts/dialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,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);
Expand Down Expand Up @@ -227,11 +228,14 @@ 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;
password_change_btn.sensitive = true;
state_label.label = _("Connected"); break;
case ConnectionManager.ConnectionState.DISCONNECTED:
active_switch.sensitive = true;
password_change_btn.sensitive = false;
state_label.label = _("Disconnected"); break;
}
Expand Down
Loading