diff --git a/src/Logic/ISecretService.cs b/src/Logic/ISecretService.cs index b9a3821..018c1d3 100644 --- a/src/Logic/ISecretService.cs +++ b/src/Logic/ISecretService.cs @@ -4,4 +4,5 @@ public interface ISecretService { public List GetCollections(); public void CreateCollection(string label); + public void DeleteCollection(string label); } diff --git a/src/Logic/PasswordStoreService.cs b/src/Logic/PasswordStoreService.cs index 1b56e75..599facf 100644 --- a/src/Logic/PasswordStoreService.cs +++ b/src/Logic/PasswordStoreService.cs @@ -22,6 +22,7 @@ public class PasswordStoreService : IPasswordStoreService public void Delete(uint ID) { + secretService.DeleteCollection(Get(ID).DisplayName ?? Get(ID).Path); repository.Delete(ID); } diff --git a/src/Logic/SecretService.cs b/src/Logic/SecretService.cs index 41f9d4c..ba737b5 100644 --- a/src/Logic/SecretService.cs +++ b/src/Logic/SecretService.cs @@ -18,7 +18,6 @@ public class SecretService : ISecretService { Secret.Collection collection = (Secret.Collection)GObject.Internal.InstanceWrapper.WrapHandle(data, false); result.Add(collection); - Console.WriteLine($" - {collection.Label}"); }); return result; } @@ -27,4 +26,9 @@ public class SecretService : ISecretService { Secret.Collection.CreateSync(service, label, null, Secret.CollectionCreateFlags.None, null); } + + public void DeleteCollection(string label) + { + GetCollections().FirstOrDefault(c => c.Label == label).DeleteSync(null); + } }