diff --git a/lib/widgets/matrix.dart b/lib/widgets/matrix.dart index 8b053c7fb..4a1512833 100644 --- a/lib/widgets/matrix.dart +++ b/lib/widgets/matrix.dart @@ -199,6 +199,12 @@ class MatrixState extends State 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 with WidgetsBindingObserver { onLoginStateChanged.remove(name); onNotification[name]?.cancel(); onNotification.remove(name); + // #Pangea + onUiaRequest[name]?.cancel(); + onUiaRequest.remove(name); + // Pangea# } void initMatrix() {