fix: register UIA listener on create login client, instead of on login (#4451)

This commit is contained in:
ggurdin 2025-10-20 16:38:36 -04:00 committed by GitHub
parent 23aa75bb13
commit 549704d6ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -199,6 +199,12 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
});
// #Pangea
candidate.homeserver = Uri.parse("https://${AppConfig.defaultHomeserver}");
// This listener is not set for the new login client until the user is logged in,
// but if the user tries to sign up without this listener set, the signup UIA request
// will hang. So set the listener here.
onUiaRequest[candidate.clientName] ??=
candidate.onUiaRequest.stream.listen(uiaRequestHandler);
// Pangea#
if (widget.clients.isEmpty) widget.clients.add(candidate);
return candidate;
@ -411,6 +417,10 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
onLoginStateChanged.remove(name);
onNotification[name]?.cancel();
onNotification.remove(name);
// #Pangea
onUiaRequest[name]?.cancel();
onUiaRequest.remove(name);
// Pangea#
}
void initMatrix() {