chore: return empty profile for the bot (#2665)
This commit is contained in:
parent
5c5c56a100
commit
37e3e9793d
2 changed files with 5 additions and 5 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:fluffychat/pangea/bot/utils/bot_name.dart';
|
||||
import 'package:fluffychat/pangea/user/models/profile_model.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
|
||||
|
|
@ -39,10 +38,6 @@ class LevelDisplayNameState extends State<LevelDisplayName> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (widget.userId == BotName.byEnvironment) {
|
||||
return const SizedBox();
|
||||
}
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8.0,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import 'package:collection/collection.dart';
|
|||
import 'package:jwt_decode/jwt_decode.dart';
|
||||
import 'package:matrix/matrix.dart' as matrix;
|
||||
|
||||
import 'package:fluffychat/pangea/bot/utils/bot_name.dart';
|
||||
import 'package:fluffychat/pangea/common/constants/model_keys.dart';
|
||||
import 'package:fluffychat/pangea/common/controllers/base_controller.dart';
|
||||
import 'package:fluffychat/pangea/common/controllers/pangea_controller.dart';
|
||||
|
|
@ -336,6 +337,10 @@ class UserController extends BaseController {
|
|||
|
||||
Future<PublicProfileModel> getPublicProfile(String userId) async {
|
||||
try {
|
||||
if (userId == BotName.byEnvironment) {
|
||||
return PublicProfileModel();
|
||||
}
|
||||
|
||||
final resp = await client.getUserProfile(userId);
|
||||
return PublicProfileModel.fromJson(resp.additionalProperties);
|
||||
} catch (e, s) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue