private async Task SelectAccountAsync(AccountViewCellViewModel item)
        {
            if (item.AccountView.IsAccount)
            {
                if (!item.AccountView.IsActive)
                {
                    await _stateService.SetActiveUserAsync(item.AccountView.UserId);

                    _messagingService.Send("switchedAccount");
                }
                else if (AllowActiveAccountSelection)
                {
                    _messagingService.Send("switchedAccount");
                }
            }
            else
            {
                _messagingService.Send("addAccount");
            }
        }
Example #2
0
        private async Task SelectAccountAsync(AccountViewCellViewModel item)
        {
            if (!item.AccountView.IsAccount)
            {
                _messagingService.Send(AccountsManagerMessageCommands.ADD_ACCOUNT);
                return;
            }

            if (!item.AccountView.IsActive)
            {
                await _stateService.SetActiveUserAsync(item.AccountView.UserId);

                _messagingService.Send(AccountsManagerMessageCommands.SWITCHED_ACCOUNT);
                if (FromIOSExtension)
                {
                    await _stateService.SaveExtensionActiveUserIdToStorageAsync(item.AccountView.UserId);
                }
            }
            else if (AllowActiveAccountSelection)
            {
                _messagingService.Send(AccountsManagerMessageCommands.SWITCHED_ACCOUNT);
            }
        }