public async Task Init(Guid id) { try { _personalModel = await _userService.GetPersonalModelAsync(ApiPriority.UserInitiated); var messageModels = await _chatService.GetConversationAsync(ApiPriority.UserInitiated, id, null); var userModels = await _userService.GetAllPublicUsersAsync(ApiPriority.UserInitiated); await _chatService.SetHasReadAsync(ApiPriority.UserInitiated, id); UpdateCollection(messageModels, userModels); // TODO : Only 1 user for now because no group chat var user = userModels.FirstOrDefault(u => u.Id == id); // TODO : Move unknown user to user service? Title = user != null ? user.DisplayName : "Unknown user"; Id = id; AvatarUrl = user?.Avatar?.Small; UserId = id; _conversationUsers = new List <ApiWhitelabelPublicUserModel> { user }; } catch (Exception ex) { ExceptionService.HandleException(ex); } }
public async Task Init(ManageType type) { try { _personalModel = await _userService.GetPersonalModelAsync(ApiPriority.UserInitiated); } catch (Exception ex) { ExceptionService.HandleException(ex); } Type = type; Items = Type == ManageType.Default ? GetDefaultItems() : await GetLanguageItems(); }
public async Task Init() { try { Locations = await PlatformService.GetLocationsAsync(ApiPriority.UserInitiated); _personalModel = await _userService.GetPersonalModelAsync(ApiPriority.UserInitiated); // Header image AvatarUrl = $"{_personalModel.Avatar.Medium}"; // About DisplayName = _personalModel.DisplayName; FirstName = _personalModel.FirstName; LastName = _personalModel.LastName; Email = _personalModel.Email; // Profile ShortIntro = _personalModel.ShortAbout; About = _personalModel.About; City = _personalModel.City; LinkedInUrl = _personalModel.LinkedInUrl; FacebookUrl = _personalModel.FacebookUrl; TwitterUrl = _personalModel.TwitterUrl; GoogleUrl = _personalModel.GooglePlusUrl; InstagramUrl = _personalModel.InstagramUrl; SelectedLocation = Locations.Find(l => l.Id == _personalModel.LocationId); SelectedLanguage = Settings.SelectedLanguageId.ToString(); OnEnableUpdate(false); } catch (Exception ex) { ExceptionService.HandleException(ex); UserDialogs.Alert(GetResource(ResKeys.mobile_error_server_error)); } }
public async Task Init() { try { _personalModel = await _userService.GetPersonalModelAsync(ApiPriority.UserInitiated); DisableAllMails = _personalModel.NotificationSettings.DisableAllMails; DisableDailyDigest = _personalModel.NotificationSettings.DisableDailyDigest; DisableNewFeedPost = _personalModel.NotificationSettings.DisableNewFeedPost; DisableNewFeedPostComment = _personalModel.NotificationSettings.DisableNewFeedPostComment; DisableMention = _personalModel.NotificationSettings.DisableMention; DisableAssigned = _personalModel.NotificationSettings.DisableAssigned; DisableAdminMails = _personalModel.NotificationSettings.DisableAdminMails; OnEnableUpdate(false); } catch (Exception ex) { Mvx.Resolve <IExceptionService>().HandleException(ex); UserDialogs.Alert(GetResource(ResKeys.mobile_error_server_error)); } }
private void OnUpdatePersonalProfile(ApiWhitelabelPrivateUserModel model) { Execute(UpdatePersonalProfile, action => action(model)); }