If a collection creation is cancelled by the user, abort

This commit is contained in:
TypoMustakes
2025-10-28 12:29:11 +01:00
parent 118aa459bb
commit bee4c398ce
2 changed files with 10 additions and 3 deletions

View File

@@ -3,6 +3,6 @@ namespace Logic;
public interface ISecretService public interface ISecretService
{ {
public List<Secret.Collection> GetCollections(); public List<Secret.Collection> GetCollections();
public void CreateCollection(string label); public bool CreateCollection(string label);
public void DeleteCollection(string label); public void DeleteCollection(string label);
} }

View File

@@ -22,9 +22,16 @@ public class SecretService : ISecretService
return result; return result;
} }
public void CreateCollection(string label) public bool CreateCollection(string label)
{
try
{ {
Secret.Collection.CreateSync(service, label, null, Secret.CollectionCreateFlags.None, null); Secret.Collection.CreateSync(service, label, null, Secret.CollectionCreateFlags.None, null);
return true;
} catch (GLib.GException ex)
{
return false;
}
} }
public void DeleteCollection(string label) public void DeleteCollection(string label)