From 512b058d34798372ef4d9598acb063847e56ab4a Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 12 Mar 2022 15:22:14 +0100 Subject: [PATCH] Fix potential load issue on user page --- lib/ui/screens/user_page_screen.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/ui/screens/user_page_screen.dart b/lib/ui/screens/user_page_screen.dart index a764a17..617c1cc 100644 --- a/lib/ui/screens/user_page_screen.dart +++ b/lib/ui/screens/user_page_screen.dart @@ -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 { // Objects members _PageStatus _status = _PageStatus.LOADING; - AdvancedUserInfo? _userInfo; + AdvancedUserInfo? _userInfo; FriendStatus? _frienshipStatus; final _refreshIndicatorKey = GlobalKey(); @@ -42,7 +41,7 @@ class _UserPageScreenState extends SafeState { @override void didChangeDependencies() { super.didChangeDependencies(); - if(_userInfo?.id != widget.userID) + if (_userInfo?.id == widget.userID) return; _getUserInfo(); }