mirror of
https://github.com/Linloir/Simple-TCP-Client.git
synced 2026-02-04 14:23:35 +08:00
Bug Fix
- Prevent profile page add self as contact
This commit is contained in:
parent
04f57dfb8a
commit
ce714e5820
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* @Author : Linloir
|
* @Author : Linloir
|
||||||
* @Date : 2022-10-14 08:54:32
|
* @Date : 2022-10-14 08:54:32
|
||||||
* @LastEditTime : 2022-10-14 11:30:59
|
* @LastEditTime : 2022-10-20 11:28:22
|
||||||
* @Description :
|
* @Description :
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -24,8 +24,10 @@ class UserProfileCubit extends Cubit<UserProfileState> {
|
|||||||
final TCPRepository tcpRepository;
|
final TCPRepository tcpRepository;
|
||||||
|
|
||||||
Future<void> updateContactStatus() async {
|
Future<void> updateContactStatus() async {
|
||||||
|
var curUserId = (await SharedPreferences.getInstance()).getInt('userid');
|
||||||
if(userID == (await SharedPreferences.getInstance()).getInt('userid')) {
|
if(userID == (await SharedPreferences.getInstance()).getInt('userid')) {
|
||||||
emit(const UserProfileState(status: ContactStatus.none));
|
emit(const UserProfileState(status: ContactStatus.none));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
var clonedTCPRepository = await tcpRepository.clone();
|
var clonedTCPRepository = await tcpRepository.clone();
|
||||||
clonedTCPRepository.pushRequest(FetchContactRequest(token: (await SharedPreferences.getInstance()).getInt('token')));
|
clonedTCPRepository.pushRequest(FetchContactRequest(token: (await SharedPreferences.getInstance()).getInt('token')));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user