From e05323c3bb9d0266b6ef0c702c351843dce3e050 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 20 Apr 2020 17:34:31 +0200 Subject: [PATCH] Fix potential issue --- lib/ui/screens/call_screen.dart | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/ui/screens/call_screen.dart b/lib/ui/screens/call_screen.dart index 44a192d..8765013 100644 --- a/lib/ui/screens/call_screen.dart +++ b/lib/ui/screens/call_screen.dart @@ -84,9 +84,15 @@ class _CallScreenState extends SafeState { setState(() {}); // Register to events - this.listenChangeState((e) { - // TODO : get user information if required - if (e.callID == convID) _membersList.add(CallMember(userID: e.userID)); + this.listen((e) async { + if (e.callID != convID) return; + try { + if (!_usersList.hasUser(e.userID)) + _usersList.add(await UsersHelper().getSingleWithThrow(e.userID)); + setState(() => _membersList.add(CallMember(userID: e.userID))); + } catch (e, stack) { + print("$e\n$stack"); + } }); this.listen((e) {