mirror of
https://github.com/bitwarden/android.git
synced 2024-11-01 07:35:52 +03:00
add item to cred store when added from extension
This commit is contained in:
parent
640beeed23
commit
ec9b2d7f7d
3 changed files with 19 additions and 4 deletions
|
@ -272,7 +272,7 @@ namespace Bit.App.Services
|
||||||
await _cipherRepository.UpsertAsync(cipher);
|
await _cipherRepository.UpsertAsync(cipher);
|
||||||
CachedCiphers = null;
|
CachedCiphers = null;
|
||||||
_appSettingsService.ClearCiphersCache = true;
|
_appSettingsService.ClearCiphersCache = true;
|
||||||
if(sendMessage)
|
if(sendMessage && Application.Current != null)
|
||||||
{
|
{
|
||||||
MessagingCenter.Send(Application.Current, "UpsertedCipher", cipher.Id);
|
MessagingCenter.Send(Application.Current, "UpsertedCipher", cipher.Id);
|
||||||
}
|
}
|
||||||
|
@ -299,7 +299,7 @@ namespace Bit.App.Services
|
||||||
if(sendMessage)
|
if(sendMessage)
|
||||||
{
|
{
|
||||||
var cipherData = await _cipherRepository.GetByIdAsync(id);
|
var cipherData = await _cipherRepository.GetByIdAsync(id);
|
||||||
if(cipherData != null)
|
if(cipherData != null && Application.Current != null)
|
||||||
{
|
{
|
||||||
MessagingCenter.Send(Application.Current, "DeletedCipher", new Cipher(cipherData));
|
MessagingCenter.Send(Application.Current, "DeletedCipher", new Cipher(cipherData));
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ namespace Bit.iOS.Autofill
|
||||||
|
|
||||||
async partial void SaveBarButton_Activated(UIBarButtonItem sender)
|
async partial void SaveBarButton_Activated(UIBarButtonItem sender)
|
||||||
{
|
{
|
||||||
await this.SaveAsync();
|
await SaveAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender)
|
public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender)
|
||||||
|
|
|
@ -13,6 +13,7 @@ using Plugin.Connectivity.Abstractions;
|
||||||
using Bit.iOS.Core.Utilities;
|
using Bit.iOS.Core.Utilities;
|
||||||
using Bit.iOS.Core.Models;
|
using Bit.iOS.Core.Models;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using AuthenticationServices;
|
||||||
|
|
||||||
namespace Bit.iOS.Core.Controllers
|
namespace Bit.iOS.Core.Controllers
|
||||||
{
|
{
|
||||||
|
@ -172,6 +173,20 @@ namespace Bit.iOS.Core.Controllers
|
||||||
await loadingAlert.DismissViewControllerAsync(true);
|
await loadingAlert.DismissViewControllerAsync(true);
|
||||||
if(saveTask.Result.Succeeded)
|
if(saveTask.Result.Succeeded)
|
||||||
{
|
{
|
||||||
|
if (await ASHelpers.IdentitiesCanIncremental())
|
||||||
|
{
|
||||||
|
var identity = await ASHelpers.GetCipherIdentityAsync(saveTask.Result.Result.Id, _cipherService);
|
||||||
|
if (identity == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await ASCredentialIdentityStore.SharedStore.SaveCredentialIdentitiesAsync(
|
||||||
|
new ASPasswordCredentialIdentity[] { identity });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await ASHelpers.ReplaceAllIdentities(_cipherService);
|
||||||
|
}
|
||||||
Success();
|
Success();
|
||||||
}
|
}
|
||||||
else if(saveTask.Result.Errors.Count() > 0)
|
else if(saveTask.Result.Errors.Count() > 0)
|
||||||
|
|
Loading…
Reference in a new issue