| | 1 | | using Cysharp.Threading.Tasks; |
| | 2 | | using DCL.Interface; |
| | 3 | | using System.Linq; |
| | 4 | | using System.Threading; |
| | 5 | |
|
| | 6 | | public class UserProfileWebInterfaceBridge : IUserProfileBridge |
| | 7 | | { |
| 0 | 8 | | public void SaveUnverifiedName(string name) => WebInterface.SendSaveUserUnverifiedName(name); |
| | 9 | |
|
| 0 | 10 | | public void SaveDescription(string description) => WebInterface.SendSaveUserDescription(description); |
| | 11 | |
|
| 0 | 12 | | public void RequestFullUserProfile(string userId) => WebInterface.SendRequestUserProfile(userId); |
| | 13 | |
|
| | 14 | | public UniTask<UserProfile> RequestFullUserProfileAsync(string userId, CancellationToken cancellationToken) => |
| 0 | 15 | | UserProfileController.i.RequestFullUserProfileAsync(userId, cancellationToken); |
| | 16 | |
|
| 989 | 17 | | public UserProfile GetOwn() => UserProfile.GetOwnUserProfile(); |
| | 18 | |
|
| | 19 | | public void AddUserProfileToCatalog(UserProfileModel userProfileModel) |
| | 20 | | { |
| 0 | 21 | | UserProfileController.i.AddUserProfileToCatalog(userProfileModel); |
| 0 | 22 | | } |
| | 23 | |
|
| | 24 | | public UserProfile Get(string userId) |
| | 25 | | { |
| 9 | 26 | | if (userId == null) return null; |
| 9 | 27 | | return UserProfileController.userProfilesCatalog.Get(userId); |
| | 28 | | } |
| | 29 | |
|
| | 30 | | public UserProfile GetByName(string userNameOrId) |
| | 31 | | { |
| 0 | 32 | | return UserProfileController.userProfilesCatalog.GetValues().FirstOrDefault(p => p.userName == userNameOrId); |
| | 33 | | } |
| | 34 | |
|
| 0 | 35 | | public void SignUp() => WebInterface.RedirectToSignUp(); |
| | 36 | | } |