mirror of
https://github.com/bitwarden/mobile
synced 2025-12-17 16:53:26 +00:00
replace vs created on save
This commit is contained in:
@@ -155,18 +155,26 @@ namespace Bit.iOS
|
||||
}
|
||||
});
|
||||
|
||||
MessagingCenter.Subscribe<Xamarin.Forms.Application, string>(
|
||||
Xamarin.Forms.Application.Current, "UpsertedCipher", async (sender, id) =>
|
||||
MessagingCenter.Subscribe<Xamarin.Forms.Application, Tuple<string, bool>>(
|
||||
Xamarin.Forms.Application.Current, "UpsertedCipher", async (sender, data) =>
|
||||
{
|
||||
if(await ASHelpers.IdentitiesCanIncremental())
|
||||
{
|
||||
var identity = await ASHelpers.GetCipherIdentityAsync(id, _cipherService);
|
||||
var identity = await ASHelpers.GetCipherIdentityAsync(data.Item1, _cipherService);
|
||||
if(identity == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
await ASCredentialIdentityStore.SharedStore.SaveCredentialIdentitiesAsync(
|
||||
new ASPasswordCredentialIdentity[] { identity });
|
||||
if(data.Item2)
|
||||
{
|
||||
await ASCredentialIdentityStore.SharedStore.SaveCredentialIdentitiesAsync(
|
||||
new ASPasswordCredentialIdentity[] { identity });
|
||||
}
|
||||
else
|
||||
{
|
||||
await ASCredentialIdentityStore.SharedStore.ReplaceCredentialIdentitiesAsync(
|
||||
new ASPasswordCredentialIdentity[] { identity });
|
||||
}
|
||||
return;
|
||||
}
|
||||
await ASHelpers.ReplaceAllIdentities(_cipherService);
|
||||
|
||||
Reference in New Issue
Block a user