- Prevent profile page add self as contact
This commit is contained in:
Linloir 2022-10-20 11:29:02 +08:00
parent 04f57dfb8a
commit ce714e5820
No known key found for this signature in database
GPG Key ID: 58EEB209A0F2C366

View File

@ -1,7 +1,7 @@
/*
* @Author : Linloir
* @Date : 2022-10-14 08:54:32
* @LastEditTime : 2022-10-14 11:30:59
* @LastEditTime : 2022-10-20 11:28:22
* @Description :
*/
@ -24,8 +24,10 @@ class UserProfileCubit extends Cubit<UserProfileState> {
final TCPRepository tcpRepository;
Future<void> updateContactStatus() async {
var curUserId = (await SharedPreferences.getInstance()).getInt('userid');
if(userID == (await SharedPreferences.getInstance()).getInt('userid')) {
emit(const UserProfileState(status: ContactStatus.none));
return;
}
var clonedTCPRepository = await tcpRepository.clone();
clonedTCPRepository.pushRequest(FetchContactRequest(token: (await SharedPreferences.getInstance()).getInt('token')));