WIP ws messages, TODO backend receiving frontend messages
This commit is contained in:
@@ -19,15 +19,15 @@ Future<JoinRoomResponse?> joinRoom(Ref ref, {required String username, required
|
||||
data: JoinRoomRequest(username: username, roomCode: code).toJson(),
|
||||
);
|
||||
|
||||
if (response.statusCode == 200 && response.data != null) {
|
||||
final joinResponse = JoinRoomResponse.fromJson(response.data!);
|
||||
final joinResponse = JoinRoomResponse.fromJson(response.data!);
|
||||
if (joinResponse.success) {
|
||||
if (joinResponse.token != null) {
|
||||
logger.fine('Setting token: ${joinResponse.token!.substring(10)}');
|
||||
await ref.read(jwtNotifierProvider.notifier).setJwt(joinResponse.token!);
|
||||
}
|
||||
return joinResponse;
|
||||
} else {
|
||||
logger.warning('Could not join room');
|
||||
logger.warning('Could not join room: ${joinResponse.toJson()}');
|
||||
}
|
||||
} catch (e) {
|
||||
logger.severe('Failed to join room', e, StackTrace.current);
|
||||
|
||||
Reference in New Issue
Block a user