1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-21 20:39:22 +00:00

Fix potential load issue on user page

This commit is contained in:
Pierre HUBERT 2022-03-12 15:22:14 +01:00
parent 73f20a543d
commit 512b058d34

View File

@ -20,8 +20,7 @@ enum _PageStatus { LOADING, ERROR, READY }
class UserPageScreen extends StatefulWidget {
final int userID;
const UserPageScreen({Key? key, required this.userID})
: super(key: key);
const UserPageScreen({Key? key, required this.userID}) : super(key: key);
@override
_UserPageScreenState createState() => _UserPageScreenState();
@ -33,7 +32,7 @@ class _UserPageScreenState extends SafeState<UserPageScreen> {
// Objects members
_PageStatus _status = _PageStatus.LOADING;
AdvancedUserInfo? _userInfo;
AdvancedUserInfo? _userInfo;
FriendStatus? _frienshipStatus;
final _refreshIndicatorKey = GlobalKey<RefreshIndicatorState>();
@ -42,7 +41,7 @@ class _UserPageScreenState extends SafeState<UserPageScreen> {
@override
void didChangeDependencies() {
super.didChangeDependencies();
if(_userInfo?.id != widget.userID)
if (_userInfo?.id == widget.userID) return;
_getUserInfo();
}