KristofferStrube/Blazor.FileSystemAccess

Bug fix for RemoveEntry

Closed this issue · 2 comments

Need new file FileSystemRemoveEntryOptions.cs under Options:

using System.Text.Json.Serialization;

namespace KristofferStrube.Blazor.FileSystemAccess;

/// <summary>
/// <see href="https://wicg.github.io/file-system-access/#dictdef-filesystemremoveentryoptions">FileSystemRemoveEntryOptions browser specs</see>
/// </summary>
public class FileSystemRemoveEntryOptions
{
    [JsonPropertyName("create")]
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
    public bool Recursive { get; set; }
}

and FileSystemDirectoryHandle.cs need to update RemoveEntryAsync to the following

public async Task RemoveEntryAsync(string name, FileSystemRemoveEntryOptions? options = null)
{
    await JSReference.InvokeVoidAsync("removeEntry", name, options);
}

Good proposal. 👍

It should just be FileSystemRemoveOptions to be consistent and then you also need to update the JsonPropertyName to recursive.

Would you be up for making a PR? Else, I will check this out myself during the week.

I'm sorry man, I'm all in shreds here, lol. I'll let you make the changes and once I reconstitute, I'll get the latest from you