fix(llc): pass includeUserDetailsInConnectCall to WS

This commit is contained in:
Salvatore Giordano
2022-04-12 15:24:17 +02:00
parent 748f4bd1b6
commit d7ee768a83
2 changed files with 11 additions and 7 deletions
@@ -377,11 +377,10 @@ class StreamChatClient {
_ws.connectionStatusStream.skip(1).listen(_connectionStatusHandler);
try {
final event = await _ws.connect(includeUserDetailsInConnectCall
? user
: User(
id: user.id,
));
final event = await _ws.connect(
user,
includeUserDetails: includeUserDetailsInConnectCall,
);
return user.merge(event.me);
} catch (e, stk) {
logger.severe('error connecting ws', e, stk);
@@ -179,7 +179,10 @@ class WebSocket with TimerHelper {
bool _connectRequestInProgress = false;
/// Connect the WS using the parameters passed in the constructor
Future<Event> connect(User user) async {
Future<Event> connect(
User user, {
bool includeUserDetails = false,
}) async {
if (_connectRequestInProgress) {
throw const StreamWebSocketError('''
You've called connect twice,
@@ -194,7 +197,9 @@ class WebSocket with TimerHelper {
connectionCompleter = Completer<Event>();
try {
final uri = await _buildUri();
final uri = await _buildUri(
includeUserDetails: includeUserDetails,
);
_initWebSocketChannel(uri);
} catch (e, stk) {
_onConnectionError(e, stk);